/* FlipHost - Estilos */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #273548;
    --bg-input: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --border: #334155;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius: 10px;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); }

/* ========== LOGIN ========== */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
}

.login-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.login-box .logo {
    text-align: center; margin-bottom: 32px;
}

.login-box .logo h1 {
    font-size: 28px; font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box .logo p {
    color: var(--text-muted); font-size: 14px; margin-top: 4px;
}

.login-tabs {
    display: flex; gap: 4px; margin-bottom: 24px;
    background: var(--bg); border-radius: 8px; padding: 4px;
}

.login-tabs button {
    flex: 1; padding: 10px; border: none;
    background: transparent; color: var(--text-muted);
    border-radius: 6px; cursor: pointer;
    font-size: 14px; font-weight: 500; transition: all .2s;
}

.login-tabs button.active {
    background: var(--primary); color: #fff;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--text-muted); margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 14px;
    transition: border-color .2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
}

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all .2s; text-decoration: none;
}

.btn-primary {
    background: var(--primary); color: #fff; width: 100%;
    justify-content: center; padding: 12px;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost {
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text-dim); color: var(--text); }

.alert {
    padding: 12px 16px; border-radius: 8px;
    margin-bottom: 16px; font-size: 14px;
}

.alert-error { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.alert-success { background: rgba(34,197,94,0.15); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.alert-info { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }

/* ========== LAYOUT PRINCIPAL ========== */
.app-layout {
    display: flex; min-height: 100vh;
}

.sidebar {
    width: 260px; background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex; flex-direction: column;
    position: fixed; height: 100vh; overflow-y: auto;
}

.sidebar .brand {
    padding: 0 8px; margin-bottom: 32px;
}

.sidebar .brand h2 {
    font-size: 20px; font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar .brand small {
    color: var(--text-dim); font-size: 12px;
}

.sidebar nav { flex: 1; }

.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    color: var(--text-muted); font-size: 14px;
    margin-bottom: 4px; transition: all .15s;
}

.sidebar nav a:hover { background: var(--bg-card-hover); color: var(--text); }
.sidebar nav a.active { background: var(--primary); color: #fff; }

.sidebar .user-info {
    padding: 12px; border-top: 1px solid var(--border);
    margin-top: auto;
}

.sidebar .user-info .name {
    font-size: 14px; font-weight: 500;
}

.sidebar .user-info .role {
    font-size: 12px; color: var(--text-dim);
}

.main-content {
    flex: 1; margin-left: 260px; padding: 32px;
}

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}

.page-header h1 { font-size: 24px; font-weight: 600; }

.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ========== TABELA ========== */
.table-wrap {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); overflow-x: auto;
}

table {
    width: 100%; border-collapse: collapse;
}

th {
    text-align: left; padding: 12px 16px;
    font-size: 12px; text-transform: uppercase;
    color: var(--text-dim); font-weight: 600;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px; font-size: 14px;
    border-bottom: 1px solid rgba(51,65,85,0.5);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-card-hover); }

/* ========== FILE MANAGER ========== */
.breadcrumb {
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 16px; font-size: 14px;
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb .sep { color: var(--text-dim); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

.file-icon {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 16px; flex-shrink: 0;
}

.file-icon.folder { background: rgba(251,191,36,0.15); color: #fbbf24; }
.file-icon.image { background: rgba(168,85,247,0.15); color: #a855f7; }
.file-icon.code { background: rgba(59,130,246,0.15); color: #3b82f6; }
.file-icon.doc { background: rgba(34,197,94,0.15); color: #22c55e; }
.file-icon.media { background: rgba(236,72,153,0.15); color: #ec4899; }
.file-icon.font { background: rgba(244,114,182,0.15); color: #f472b6; }
.file-icon.archive { background: rgba(249,115,22,0.15); color: #f97316; }
.file-icon.other { background: rgba(148,163,184,0.15); color: #94a3b8; }

.file-name {
    display: flex; align-items: center; gap: 12px;
}

.file-name a { color: var(--text); font-weight: 500; }
.file-name a:hover { color: var(--primary-light); }

.file-actions {
    display: flex; gap: 4px;
}

.file-actions button {
    padding: 6px 8px; background: transparent;
    border: none; color: var(--text-dim); cursor: pointer;
    border-radius: 6px; font-size: 16px; transition: all .15s;
}

.file-actions button:hover { background: var(--bg-card-hover); color: var(--text); }
.file-actions button.del:hover { color: var(--danger); }

/* ========== STORAGE BAR ========== */
.storage-bar {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); padding: 16px;
    margin-bottom: 24px;
}

.storage-bar .bar {
    height: 8px; background: var(--bg-input);
    border-radius: 4px; overflow: hidden; margin: 8px 0;
}

.storage-bar .bar .fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width .3s;
}

.storage-bar .bar .fill.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.storage-bar .bar .fill.danger { background: linear-gradient(90deg, var(--danger), #f87171); }

.storage-bar .info {
    display: flex; justify-content: space-between;
    font-size: 13px; color: var(--text-muted);
}

/* ========== UPLOAD ZONE ========== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius); padding: 40px;
    text-align: center; cursor: pointer;
    transition: all .2s; margin-bottom: 24px;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary); background: rgba(99,102,241,0.05);
}

.upload-zone .icon { font-size: 40px; margin-bottom: 8px; }
.upload-zone p { color: var(--text-muted); font-size: 14px; }
.upload-zone .hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.upload-progress {
    display: none; margin-top: 16px;
}

.upload-progress .file-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 0; font-size: 13px;
}

.upload-progress .file-item .progress-bar {
    flex: 1; height: 4px; background: var(--bg-input);
    border-radius: 2px; overflow: hidden;
}

.upload-progress .file-item .progress-bar .fill {
    height: 100%; background: var(--primary);
    border-radius: 2px; transition: width .2s;
}

.upload-progress .file-item .status { width: 20px; text-align: center; }

/* ========== MODAL ========== */
.modal-overlay {
    display: none; position: fixed;
    inset: 0; background: rgba(0,0,0,0.6);
    z-index: 100; align-items: center; justify-content: center;
    padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border-radius: 16px; padding: 32px;
    width: 100%; max-width: 480px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.modal h3 { font-size: 18px; margin-bottom: 20px; }

.modal-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    margin-top: 24px;
}

/* ========== BADGE ========== */
.badge {
    display: inline-flex; padding: 2px 10px;
    border-radius: 20px; font-size: 12px; font-weight: 500;
}

.badge-active { background: rgba(34,197,94,0.15); color: #86efac; }
.badge-inactive { background: rgba(239,68,68,0.15); color: #fca5a5; }
.badge-admin { background: rgba(168,85,247,0.15); color: #c084fc; }

/* ========== STATS ========== */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); padding: 20px;
}

.stat-card .label { font-size: 13px; color: var(--text-muted); }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 4px; }

/* ========== LOGS ========== */
.log-item {
    display: flex; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid rgba(51,65,85,0.3);
    font-size: 13px;
}

.log-item .time { color: var(--text-dim); white-space: nowrap; min-width: 140px; }
.log-item .action { font-weight: 500; min-width: 100px; }
.log-item .details { color: var(--text-muted); flex: 1; }

/* ========== ACCESS CODE ========== */
.code-display {
    background: var(--bg); border-radius: 8px;
    padding: 20px; text-align: center;
    border: 1px dashed var(--primary);
    margin: 16px 0;
}

.code-display .code {
    font-size: 32px; font-weight: 700;
    letter-spacing: 4px; color: var(--primary-light);
    font-family: 'Courier New', monospace;
}

.code-display .hint {
    font-size: 12px; color: var(--text-dim); margin-top: 8px;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed; left: -260px;
        z-index: 50; transition: left .3s;
    }
    .sidebar.open { left: 0; }
    .main-content { margin-left: 0; padding: 16px; }
    .mobile-toggle {
        display: flex !important; position: fixed;
        top: 16px; left: 16px; z-index: 40;
        background: var(--bg-card); border: 1px solid var(--border);
        border-radius: 8px; padding: 8px 12px;
        color: var(--text); cursor: pointer; font-size: 20px;
    }
    .page-header { padding-top: 48px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

.mobile-toggle { display: none; }

/* ========== DARK SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 15px; }
