/* ============================================================
   AquaMag PMS — Main Stylesheet
   Design: Editorial/Marine — Deep ocean tones, refined typography
   ============================================================ */

:root {
    /* Core Palette */
    --ocean-deep:    #070f1e;
    --ocean-mid:     #0d1b2e;
    --ocean-surface: #112240;
    --ocean-glass:   #1a3358;
    --teal-accent:   #0ea5e9;
    --teal-glow:     #38bdf8;
    --teal-soft:     #0ea5e920;
    --coral:         #f97316;
    --emerald:       #10b981;
    --amber:         #f59e0b;
    --rose:          #f43f5e;

    /* Text */
    --text-primary:  #e2eaf5;
    --text-secondary:#8da4be;
    --text-muted:    #4d6382;

    /* Surfaces */
    --surface-1:     #0d1b2e;
    --surface-2:     #112240;
    --surface-3:     #1a3358;
    --surface-hover: #1f3d68;
    --border:        #1e3a5f;
    --border-light:  #243f66;

    /* Layout */
    --sidebar-w:     260px;
    --header-h:      64px;
    --radius:        10px;
    --radius-lg:     16px;
    --shadow:        0 4px 24px rgba(0,0,0,0.4);
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.3);

    /* Fonts */
    --font-display:  'Playfair Display', serif;
    --font-body:     'DM Sans', sans-serif;
    --font-mono:     'DM Mono', monospace;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--ocean-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--teal-accent); text-decoration: none; }
a:hover { color: var(--teal-glow); }

img { max-width: 100%; height: auto; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface-1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.sidebar-brand {
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    min-height: var(--header-h);
    flex-shrink: 0;
}

.brand-logo { width: 38px; height: 38px; flex-shrink: 0; }
.brand-text { flex: 1; min-width: 0; }
.brand-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.brand-sub {
    display: block;
    font-size: 0.7rem;
    color: var(--teal-accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
}
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-section { margin-bottom: 6px; }
.nav-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 10px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: 2px;
}
.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}
.nav-item.active {
    background: var(--teal-soft);
    color: var(--teal-glow);
    border-left: 3px solid var(--teal-accent);
    padding-left: 7px;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.8;
}
.nav-icon svg { width: 100%; height: 100%; }

.sidebar-user {
    padding: 14px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.user-avatar-sm {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-accent), #0369a1);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700; color: white;
    flex-shrink: 0; overflow: hidden;
}
.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-settings-btn {
    color: var(--text-muted);
    font-size: 1rem;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
}
.user-settings-btn:hover { color: var(--teal-accent); background: var(--surface-hover); }

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s;
}

/* ===== TOP HEADER ===== */
.top-header {
    position: sticky;
    top: 0;
    height: var(--header-h);
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 16px;
    z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 14px; flex: 1; }
.header-right { display: flex; align-items: center; gap: 10px; }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none; border: none; cursor: pointer;
    padding: 6px; border-radius: 6px;
}
.hamburger span {
    display: block;
    width: 20px; height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.2s;
}
.hamburger:hover span { background: var(--text-primary); }

.breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.85rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--teal-accent); }
.bc-sep { color: var(--text-muted); font-size: 0.75rem; }
.bc-current { color: var(--text-primary); font-weight: 500; }

/* Header Search */
.header-search form {
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}
.header-search form:focus-within { border-color: var(--teal-accent); }
.header-search input {
    background: none; border: none; outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 8px 12px;
    width: 220px;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search button {
    background: none; border: none; cursor: pointer;
    padding: 8px 10px; color: var(--text-muted);
    display: flex; align-items: center;
}
.header-search button svg { width: 16px; height: 16px; }
.header-search button:hover { color: var(--teal-accent); }

/* Notifications */
.header-notif { position: relative; }
.notif-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
}
.notif-btn svg { width: 18px; height: 18px; }
.notif-btn:hover { border-color: var(--teal-accent); color: var(--teal-accent); }
.notif-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 18px; height: 18px;
    background: var(--rose);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--surface-1);
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    z-index: 300;
    overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 0.9rem;
}
.notif-header a { font-size: 0.78rem; font-weight: 400; color: var(--text-muted); }
.notif-header a:hover { color: var(--teal-accent); }

.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.notif-item:hover { background: var(--surface-3); }
.notif-item.unread { border-left: 3px solid var(--teal-accent); }
.notif-item-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 3px; }
.notif-item-msg { font-size: 0.78rem; color: var(--text-secondary); }
.notif-item-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.notif-loading { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.notif-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.notif-footer a { font-size: 0.82rem; color: var(--text-muted); }
.notif-footer a:hover { color: var(--teal-accent); }

/* User Menu */
.header-user-menu { position: relative; }
.user-menu-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 10px 5px 5px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-body);
    transition: all 0.15s;
}
.user-menu-btn:hover { border-color: var(--teal-accent); }
.user-avatar-xs {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-accent), #0369a1);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700; color: white;
    overflow: hidden; flex-shrink: 0;
}
.user-avatar-xs img { width: 100%; height: 100%; object-fit: cover; }
.user-name-short { font-weight: 500; }

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    z-index: 300;
    overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.user-dropdown-header strong { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.user-dropdown-header span { font-size: 0.75rem; color: var(--text-muted); }
.user-dropdown a {
    display: block;
    padding: 10px 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.user-dropdown a:hover { background: var(--surface-3); color: var(--text-primary); }
.user-dropdown a.logout-link { color: var(--rose); }
.user-dropdown a.logout-link:hover { background: rgba(244,63,94,0.1); }

/* ===== FLASH MESSAGES ===== */
.flash-msg {
    margin: 12px 20px;
    padding: 12px 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 500;
}
.flash-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.flash-error   { background: rgba(244,63,94,0.15);  border: 1px solid rgba(244,63,94,0.3);  color: #fca5a5; }
.flash-info    { background: rgba(14,165,233,0.15);  border: 1px solid rgba(14,165,233,0.3); color: #7dd3fc; }
.flash-msg button { background: none; border: none; cursor: pointer; color: inherit; opacity: 0.7; padding: 0 4px; }

/* ===== PAGE CONTENT ===== */
.page-content { flex: 1; padding: 24px; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.page-header-left h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.page-header-left p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== CARDS ===== */
.card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.15s;
}
.card:hover { border-color: var(--border-light); }
.card-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent-color, var(--teal-accent));
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-light); }
.stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; }
.stat-value { font-size: 2rem; font-weight: 700; font-family: var(--font-display); color: var(--text-primary); line-height: 1; }
.stat-sub { font-size: 0.78rem; color: var(--text-secondary); }
.stat-icon { position: absolute; top: 14px; right: 14px; font-size: 1.6rem; opacity: 0.15; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--teal-accent); color: #ffffff; }
.btn-primary:hover { background: var(--teal-glow); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14,165,233,0.4); }
.btn-secondary { background: var(--surface-3); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-light); color: var(--text-primary); }
.btn-danger { background: rgba(244,63,94,0.15); color: #f43f5e; border: 1px solid rgba(244,63,94,0.3); }
.btn-danger:hover { background: rgba(244,63,94,0.25); color: #f43f5e; }
.btn-success { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.btn-success:hover { background: rgba(16,185,129,0.25); color: #10b981; }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn-icon { padding: 8px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    padding: 11px 14px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--surface-1);
}
td {
    padding: 12px 14px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-3); }
td a { color: var(--text-primary); font-weight: 500; }
td a:hover { color: var(--teal-accent); }

/* ===== FORMS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=url], select, textarea {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    padding: 10px 14px;
    transition: border-color 0.15s;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--teal-accent);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
select option { background: var(--surface-2); }
textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); }
.form-error { font-size: 0.75rem; color: var(--rose); }

/* ===== BADGES / TAGS ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--surface-3);
    color: var(--text-secondary);
}

/* ===== KANBAN ===== */
.kanban-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 20px;
    align-items: flex-start;
}
.kanban-col {
    flex: 0 0 240px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.kanban-col-header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.kanban-col-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.kanban-count {
    background: var(--surface-3);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}
.kanban-col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.kanban-card {
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.15s;
    cursor: pointer;
}
.kanban-card:hover { border-color: var(--teal-accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.kanban-card-title { font-size: 0.82rem; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); line-height: 1.3; }
.kanban-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kanban-card-type { font-size: 0.7rem; color: var(--text-muted); }
.kanban-card-author { font-size: 0.72rem; color: var(--text-secondary); }

/* ===== TIMELINE / PROGRESS ===== */
.progress-bar {
    height: 6px;
    background: var(--surface-3);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--teal-accent), var(--teal-glow));
    transition: width 0.5s ease;
}

/* ===== FILTERS BAR ===== */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filters-bar select, .filters-bar input {
    width: auto;
    flex-shrink: 0;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: 0.3; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* ===== ARTICLE VIEW ===== */
.article-body { font-size: 0.95rem; line-height: 1.8; color: var(--text-secondary); }
.article-body h1, .article-body h2, .article-body h3 { color: var(--text-primary); margin: 1.2em 0 0.5em; font-family: var(--font-display); }
.article-body p { margin-bottom: 1em; }
.article-body ul, .article-body ol { padding-left: 1.5em; margin-bottom: 1em; }

/* ===== DETAIL PANEL ===== */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    gap: 12px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-size: 0.78rem; font-weight: 500; flex-shrink: 0; }
.detail-value { color: var(--text-primary); font-weight: 500; text-align: right; }

/* ===== WORKFLOW STEPS ===== */
.workflow-steps {
    display: flex;
    gap: 0;
    overflow-x: auto;
    margin-bottom: 24px;
}
.workflow-step {
    flex: 1;
    min-width: 90px;
    text-align: center;
    position: relative;
    padding: 10px 4px;
}
.workflow-step::after {
    content: '';
    position: absolute;
    top: 18px;
    right: -4px;
    width: 50%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.workflow-step:last-child::after { display: none; }
.workflow-step::before {
    content: '';
    position: absolute;
    top: 18px;
    left: -4px;
    width: 50%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.workflow-step:first-child::before { display: none; }
.step-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--surface-3);
    border: 2px solid var(--border);
    margin: 0 auto 6px;
    position: relative;
    z-index: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700;
}
.workflow-step.done .step-dot { background: var(--emerald); border-color: var(--emerald); color: white; }
.workflow-step.active .step-dot { background: var(--teal-accent); border-color: var(--teal-accent); color: white; }
.step-label { font-size: 0.65rem; color: var(--text-muted); line-height: 1.3; }
.workflow-step.done .step-label { color: var(--emerald); }
.workflow-step.active .step-label { color: var(--teal-accent); font-weight: 600; }

/* ===== COMMENTS ===== */
.comment {
    padding: 14px;
    background: var(--surface-3);
    border-radius: var(--radius);
    margin-bottom: 12px;
    border-left: 3px solid var(--border);
}
.comment.unresolved { border-left-color: var(--amber); }
.comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.comment-author { font-size: 0.82rem; font-weight: 600; }
.comment-time { font-size: 0.72rem; color: var(--text-muted); }
.comment-body { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }

/* ===== AVATAR GROUP ===== */
.avatar-group { display: flex; }
.avatar-group .av {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--surface-2);
    margin-left: -6px;
    background: linear-gradient(135deg, var(--teal-accent), #0369a1);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 700; color: white;
    overflow: hidden;
}
.avatar-group .av:first-child { margin-left: 0; }

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 150;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ===== MODAL ===== */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-family: var(--font-display); font-size: 1.1rem; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; padding: 4px; }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .header-search input { width: 160px; }
}

@media (max-width: 768px) {
    :root { --sidebar-w: 260px; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .main-wrapper { margin-left: 0; }
    .hamburger { display: flex; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .header-search { display: none; }
    .page-header { flex-direction: column; }
    .page-header-actions { width: 100%; }
    .kanban-board { flex-direction: column; }
    .kanban-col { flex: unset; width: 100%; }
    .workflow-steps { flex-wrap: wrap; }
    .user-name-short { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .filters-bar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
    .page-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .notif-dropdown { width: 300px; right: -40px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-1); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ocean-glass); }

/* ===== UTILITIES ===== */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--emerald); }
.text-danger { color: var(--rose); }
.text-warning { color: var(--amber); }
.text-accent { color: var(--teal-accent); }
.font-display { font-family: var(--font-display); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
