/* ═══════════════════════════════════════════════════════════════
   Admiral — Base CSS
   Reset, login screen, app shell, sidebar, topbar, scrollbar.
   View-specific CSS goes in separate files (board.css, calendar.css, etc.)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1c1f3b;
    color: #d5d8df;
    line-height: 1.4;
    overflow: hidden;
    height: 100vh;
}

/* ─── Login Screen ────────────────────────────────────────────── */
.login-screen {
    display: flex; align-items: center; justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #141627 0%, #1c1f3b 40%, #252850 100%);
}
.login-card {
    width: 380px; padding: 40px;
    background: #1e2145;
    border: 1px solid #2a2d4a;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, #6c6ff5, #4e51d4);
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
    margin-bottom: 12px;
}
.login-logo h1 { font-size: 24px; font-weight: 700; color: #fff; }
.login-logo p { font-size: 13px; color: #6b6f88; margin-top: 4px; }

.login-field { margin-bottom: 16px; }
.login-field label {
    display: block; font-size: 12px; font-weight: 600;
    color: #9399b2; margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.login-field input {
    width: 100%; padding: 10px 14px;
    background: #252850; border: 1px solid #3a3d5c;
    border-radius: 6px; color: #d5d8df;
    font-size: 14px; font-family: inherit;
    transition: border-color .15s;
}
.login-field input:focus { outline: none; border-color: #6c6ff5; background: #2a2d55; }
.login-field input::placeholder { color: #555876; }

.login-btn {
    width: 100%; padding: 11px;
    background: #6c6ff5; color: #fff;
    border: none; border-radius: 6px;
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background .12s;
    margin-top: 8px; font-family: inherit;
}
.login-btn:hover { background: #5b5ee0; }

.login-error {
    background: rgba(228,66,88,.15); border: 1px solid #e44258;
    color: #e44258; padding: 8px 12px; border-radius: 6px;
    font-size: 13px; margin-bottom: 16px; text-align: center;
}

.login-footer {
    text-align: center; margin-top: 20px;
    font-size: 12px; color: #555876;
}

/* ─── App Shell ───────────────────────────────────────────────── */
.app { display: flex; height: 100vh; }

/* ─── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: 220px; flex-shrink: 0;
    background: #141627;
    border-right: 1px solid #2a2d4a;
    display: flex; flex-direction: column;
    overflow-y: auto;
}
.sidebar-logo {
    padding: 16px 18px 14px;
    border-bottom: 1px solid #2a2d4a;
    display: flex; align-items: center; gap: 10px;
}
.sidebar-logo .logo-mark {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, #6c6ff5, #4e51d4);
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #fff; flex-shrink: 0;
}
.sidebar-logo .logo-text {
    font-size: 16px; font-weight: 700; color: #fff;
}

/* Project switcher */
.sidebar-switcher { padding: 10px 14px; border-bottom: 1px solid #2a2d4a; }
.project-select {
    width: 100%; padding: 6px 10px;
    background: #252850; border: 1px solid #3a3d5c;
    border-radius: 5px; color: #d5d8df;
    font-size: 12px; font-family: inherit;
    cursor: pointer;
}
.project-select:focus { outline: none; border-color: #6c6ff5; }

.sidebar-section {
    padding: 14px 18px 6px;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: #555876;
}
.sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 18px;
    color: #8b8fa3; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all .12s;
    text-decoration: none;
}
.sidebar-item:hover { background: #1e2145; color: #c5c8d6; }
.sidebar-item.active {
    background: #252850; color: #fff;
    border-left: 3px solid #6c6ff5; padding-left: 15px;
}
.sidebar-item i { width: 16px; text-align: center; font-size: 12px; }
.soon-tag {
    font-size: 9px; color: #555876; background: #252850;
    padding: 1px 5px; border-radius: 3px; margin-left: auto;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 10px 14px;
    border-top: 1px solid #2a2d4a;
}
.sidebar-user {
    display: flex; align-items: center; gap: 8px; padding: 6px;
}
.user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name {
    font-size: 12px; font-weight: 500; color: #d5d8df;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 10px; color: #6b6f88; }

.logout-form { display: inline; }
.logout-btn {
    background: none; border: none;
    color: #555876; cursor: pointer;
    font-size: 12px; padding: 4px;
    transition: color .12s;
}
.logout-btn:hover { color: #e44258; }

/* ─── Main Area ───────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
    height: 44px; flex-shrink: 0;
    background: #1c1f3b;
    border-bottom: 1px solid #2a2d4a;
    display: flex; align-items: center;
    padding: 0 24px; gap: 12px;
}
.topbar-title { font-size: 15px; font-weight: 600; color: #fff; }
.topbar-breadcrumb { font-size: 12px; color: #6b6f88; }
.content { flex: 1; overflow: auto; background: #1c1f3b; }

/* ─── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #1c1f3b; }
::-webkit-scrollbar-thumb { background: #3a3d5c; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4a4d6c; }

/* ─── Shared button styles ────────────────────────────────────── */
.mb-btn-new {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    background: #6c6ff5; color: #fff;
    border: none; border-radius: 4px;
    font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: background .12s;
}
.mb-btn-new:hover { background: #5b5ee0; }

/* ─── Sidebar add button ─────────────────────────────────────── */
.sidebar-add-btn {
    background: none; border: none; color: #555876;
    cursor: pointer; font-size: 11px; padding: 2px 5px;
    border-radius: 3px; transition: all .12s;
}
.sidebar-add-btn:hover { background: #252850; color: #6c6ff5; }

/* ─── Modal overlay ──────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; }
.modal {
    background: #1e2145; border: 1px solid #2a2d4a;
    border-radius: 10px; width: 420px; max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    transform: translateY(10px); transition: transform .2s;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #2a2d4a;
}
.modal-title { font-size: 15px; font-weight: 600; color: #fff; }
.modal-close {
    background: none; border: none; color: #6b6f88;
    font-size: 20px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: #e44258; }
.modal-body { padding: 20px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 20px; border-top: 1px solid #2a2d4a;
}
.modal-btn {
    padding: 7px 16px; border: none; border-radius: 5px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: background .12s;
}
.modal-btn.cancel { background: #252850; color: #9399b2; }
.modal-btn.cancel:hover { background: #2a2d55; }
.modal-btn.confirm { background: #6c6ff5; color: #fff; }
.modal-btn.confirm:hover { background: #5b5ee0; }

.modal-field { margin-bottom: 14px; }
.modal-field label {
    display: block; font-size: 11px; font-weight: 600;
    color: #9399b2; margin-bottom: 5px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.modal-field input, .modal-field select, .modal-field textarea {
    width: 100%; padding: 8px 12px;
    background: #252850; border: 1px solid #3a3d5c;
    border-radius: 5px; color: #d5d8df;
    font-size: 13px; font-family: inherit;
}
.modal-field input:focus, .modal-field select:focus, .modal-field textarea:focus {
    outline: none; border-color: #6c6ff5;
}

/* ─── Toast notifications ────────────────────────────────────── */
.toast {
    position: fixed; bottom: 20px; right: 20px; z-index: 2000;
    padding: 10px 18px; border-radius: 6px;
    font-size: 13px; font-weight: 500;
    opacity: 0; transform: translateY(10px);
    transition: all .3s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #00c875; color: #fff; }
.toast-error { background: #e44258; color: #fff; }
.toast-info { background: #579bfc; color: #fff; }

/* ─── Inline editing ─────────────────────────────────────────── */
.inline-input, .inline-select, .inline-textarea {
    width: 100%; padding: 3px 6px;
    background: #252850; border: 1px solid #6c6ff5;
    border-radius: 3px; color: #d5d8df;
    font-size: 12px; font-family: inherit;
}
.inline-input:focus, .inline-select:focus, .inline-textarea:focus {
    outline: none;
}
.title-edit { font-weight: 500; font-size: 13px; }
.confirm-text { color: #d5d8df; font-size: 14px; }
