/* LoydDrop — Dark Industrial Theme */

:root {
    --bg:            #0d0d0d;
    --surface:       #181818;
    --card:          #1e1e1e;
    --border:        #2a2a2a;
    --border-bright: #3a3a3a;
    --text:          #e8e8e8;
    --text-muted:    #777;
    --accent:        #e8670f;
    --accent-glow:   rgba(232, 103, 15, 0.12);
    --success:       #2d8a4e;
    --success-text:  #5db870;
    --error:         #a32b2b;
    --error-text:    #e05555;
    --warn-text:     #c8a43a;
    --radius:        4px;
    --font-mono:     'Courier New', Courier, monospace;
    --font-body:     system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

/* ------------------------------------------------------------------ */
/* Loyding overlay                                                      */
/* ------------------------------------------------------------------ */

#loyding-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loyding-box {
    background: var(--card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 32px 56px;
    text-align: center;
}

.loyding-text {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--accent);
    letter-spacing: 0.1em;
}

/* ------------------------------------------------------------------ */
/* Navbar                                                               */
/* ------------------------------------------------------------------ */

.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.18em;
}
.brand:hover { color: #ff8533; }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-badge {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    background: var(--accent);
    color: #000;
    padding: 2px 8px;
    border-radius: 2px;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.nav-user {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
}
.nav-link:hover { color: var(--text); }

/* ------------------------------------------------------------------ */
/* Main content                                                         */
/* ------------------------------------------------------------------ */

.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ------------------------------------------------------------------ */
/* Alerts                                                               */
/* ------------------------------------------------------------------ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-error {
    background: rgba(163, 43, 43, 0.18);
    border-color: var(--error);
    color: var(--error-text);
}

.alert-success {
    background: rgba(45, 138, 78, 0.18);
    border-color: var(--success);
    color: var(--success-text);
}

.alert-new-user {
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.new-user-header {
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cred-row {
    margin: 5px 0;
    font-family: var(--font-mono);
    font-size: 0.92rem;
}

.cred-label {
    color: var(--text-muted);
    margin-right: 6px;
}

.cred-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

code {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.07);
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 0.9em;
    word-break: break-all;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                              */
/* ------------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.87rem;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    background: var(--accent);
    color: #000;
    white-space: nowrap;
}
.btn:hover { background: #ff8533; }

.btn-full { width: 100%; }

.btn-sm { padding: 5px 11px; font-size: 0.8rem; }

.btn-ghost {
    background: transparent;
    border-color: var(--border-bright);
    color: var(--text-muted);
}
.btn-ghost:hover {
    border-color: var(--text-muted);
    color: var(--text);
    background: transparent;
}

.btn-danger {
    background: transparent;
    border-color: var(--error);
    color: var(--error-text);
}
.btn-danger:hover { background: rgba(163, 43, 43, 0.18); }

/* ------------------------------------------------------------------ */
/* Cards                                                                */
/* ------------------------------------------------------------------ */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.card-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* ------------------------------------------------------------------ */
/* Forms                                                                */
/* ------------------------------------------------------------------ */

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

.form-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 9px 12px;
    font-size: 0.93rem;
    font-family: var(--font-body);
    transition: border-color 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent);
}
.form-input::placeholder { color: var(--text-muted); }

.pin-input {
    width: 180px;
    text-align: center;
    font-size: 2rem;
    letter-spacing: 0.5em;
    font-family: var(--font-mono);
    margin: 0 auto;
    display: block;
}

/* ------------------------------------------------------------------ */
/* Auth pages                                                           */
/* ------------------------------------------------------------------ */

.auth-page {
    min-height: calc(100vh - 52px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 380px;
}

.auth-logo {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.2em;
    margin-bottom: 24px;
}

.auth-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text);
}

.auth-hint {
    margin-top: 18px;
    text-align: center;
    font-size: 0.82rem;
}

.auth-hint-link {
    color: var(--text-muted);
    text-decoration: none;
}
.auth-hint-link:hover { color: var(--accent); }

/* ------------------------------------------------------------------ */
/* Quota bar                                                            */
/* ------------------------------------------------------------------ */

.quota-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-family: var(--font-mono);
}

.quota-track {
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.quota-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent);
    transition: width 0.4s;
}
.quota-fill.warn     { background: var(--warn-text); }
.quota-fill.critical { background: var(--error-text); }

.mini-quota-track {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    width: 90px;
    display: inline-block;
    vertical-align: middle;
}

.mini-quota-fill {
    height: 100%;
    background: var(--accent);
}
.mini-quota-fill.warn     { background: var(--warn-text); }
.mini-quota-fill.critical { background: var(--error-text); }

/* ------------------------------------------------------------------ */
/* Page header                                                          */
/* ------------------------------------------------------------------ */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.text-muted { color: var(--text-muted); }

/* ------------------------------------------------------------------ */
/* Breadcrumb                                                           */
/* ------------------------------------------------------------------ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb-sep     { color: var(--border-bright); }
.breadcrumb-current { color: var(--text-muted); }

.breadcrumb-back {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 4px;
}
.breadcrumb-back:hover { color: var(--accent); }

/* ------------------------------------------------------------------ */
/* Folder grid                                                          */
/* ------------------------------------------------------------------ */

.folder-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.folder-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 14px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.87rem;
    transition: border-color 0.15s, color 0.15s;
}
.folder-item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ------------------------------------------------------------------ */
/* Inline form row                                                      */
/* ------------------------------------------------------------------ */

.inline-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.inline-form .form-group { margin-bottom: 0; }

/* ------------------------------------------------------------------ */
/* Create user grid                                                     */
/* ------------------------------------------------------------------ */

.create-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    align-items: end;
}

/* ------------------------------------------------------------------ */
/* File table                                                           */
/* ------------------------------------------------------------------ */

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

.file-table th {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.file-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.file-table tr:last-child td { border-bottom: none; }
.file-table tr:hover td { background: rgba(255,255,255,0.02); }

.file-name {
    font-family: var(--font-mono);
    font-size: 0.87rem;
    word-break: break-all;
}

.file-size {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.file-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.file-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.badge-admin {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    background: var(--accent-glow);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid rgba(232, 103, 15, 0.3);
    vertical-align: middle;
    margin-left: 6px;
}

/* ------------------------------------------------------------------ */
/* User table (admin dashboard)                                         */
/* ------------------------------------------------------------------ */

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

.user-table th {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.user-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: rgba(255,255,255,0.02); }

.user-inactive { opacity: 0.45; }

/* ------------------------------------------------------------------ */
/* Upload zone                                                          */
/* ------------------------------------------------------------------ */

.upload-zone {
    border: 2px dashed var(--border-bright);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    color: var(--text-muted);
    user-select: none;
}
.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.upload-zone-icon { font-size: 2.2rem; margin-bottom: 10px; }
.upload-zone-text { font-size: 0.9rem; margin-bottom: 4px; }
.upload-zone-hint { font-size: 0.78rem; }

/* ------------------------------------------------------------------ */
/* Upload progress                                                      */
/* ------------------------------------------------------------------ */

.upload-progress-container { display: none; }

.upload-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 8px;
}

.upload-item-name {
    font-family: var(--font-mono);
    font-size: 0.83rem;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.upload-progress-track {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.upload-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.2s;
}
.upload-progress-fill.done  { background: var(--success-text); }
.upload-progress-fill.error { background: var(--error-text); }

.upload-item-status {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.upload-item-status.done  { color: var(--success-text); }
.upload-item-status.error { color: var(--error-text); }

/* ------------------------------------------------------------------ */
/* Error page                                                           */
/* ------------------------------------------------------------------ */

.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-code {
    font-family: var(--font-mono);
    font-size: 5rem;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 14px;
}

.error-msg {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 28px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                           */
/* ------------------------------------------------------------------ */

@media (max-width: 600px) {
    .main-content       { padding: 16px 12px 40px; }
    .auth-card          { padding: 28px 20px; }
    .navbar             { padding: 0 14px; }

    .file-table td:nth-child(3),
    .file-table th:nth-child(3) { display: none; }

    .user-table td:nth-child(3),
    .user-table th:nth-child(3),
    .user-table td:nth-child(4),
    .user-table th:nth-child(4) { display: none; }

    .page-header        { flex-direction: column; }
    .create-user-grid   { grid-template-columns: 1fr; }
    .file-actions       { flex-wrap: wrap; }
}
