/* ============================================================
   MAIL MANAGEMENT SYSTEM - LIGHT THEME (Orange / Green)
   assets/css/style.css
   ============================================================ */

:root {
    --bg-primary:       #fefae0;
    --bg-secondary:     #ffffff;
    --bg-tertiary:      #fff8e1;
    --bg-card:          #ffffff;
    --accent-primary:   #f4a261;
    --accent-secondary: #e76f51;
    --accent-tertiary:  #e9c46a;
    --accent-green:     #2a9d8f;
    --accent-purple:    #8b5cf6;
    --text-primary:     #264653;
    --text-secondary:   #5a6b75;
    --text-muted:       #94a3ac;
    --border-color:     #f0e2c0;
    --border-hover:     #f4a261;
    --success:          #2a9d8f;
    --warning:          #e9a23b;
    --danger:           #e76f51;
    --info:             #4f86c6;
    --sidebar-width:    280px;
    --topbar-height:    80px;
    --border-radius:    12px;
    --border-radius-lg: 20px;
    --transition:       all 0.3s ease;
    --shadow:           0 10px 30px rgba(38, 70, 83, 0.08);
    --shadow-glow:      0 0 20px rgba(244, 162, 97, 0.35);
    --shadow-hover:     0 20px 40px rgba(244, 162, 97, 0.18);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #fff8e1 100%);
    color: var(--text-primary);
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--accent-secondary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-primary); }

::-webkit-scrollbar          { width: 8px; height: 8px; }
::-webkit-scrollbar-track    { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb    { background: var(--accent-primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-secondary); }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: var(--transition);
    box-shadow: 2px 0 15px rgba(38,70,83,0.04);
}

.sidebar-logo {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(244,162,97,0.08) 0%, rgba(233,196,106,0.08) 100%);
}

.sidebar-logo .logo-icon {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.sidebar-logo .logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-section { padding: 1.5rem 0; flex: 1; }

.nav-section-label {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.nav-item { padding: 0.25rem 1rem; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    font-weight: 600;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--accent-secondary);
    padding-left: 1.3rem;
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(244,162,97,0.18) 0%, rgba(231,111,81,0.1) 100%);
    color: var(--accent-secondary);
    border-left: 3px solid var(--accent-primary);
}

.nav-link .nav-icon { width: 20px; font-size: 1rem; text-align: center; flex-shrink: 0; color: var(--accent-primary); }
.nav-link.active .nav-icon { color: var(--accent-secondary); }

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.nav-badge.warning { background: var(--warning); color: #000; }
.nav-badge.success { background: var(--success); color: #fff; }
.nav-badge.info    { background: var(--info); color: #fff; }

.sidebar-user {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-user:hover { background: var(--bg-tertiary); }

.sidebar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-name { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.sidebar-user-role { font-size: 0.75rem; color: var(--text-muted); }

/* ===== TOPBAR ===== */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 900;
    box-shadow: 0 2px 15px rgba(38,70,83,0.04);
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }

.search-wrapper { position: relative; max-width: 360px; width: 100%; }

.search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(244,162,97,0.2);
    background: #fff;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.topbar-right { display: flex; align-items: center; gap: 1.5rem; }

.topbar-icon {
    position: relative;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-icon:hover { background: var(--bg-tertiary); color: var(--accent-secondary); }

.topbar-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.topbar-user:hover { background: var(--bg-tertiary); }

.topbar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: var(--shadow-glow);
}

.topbar-user-name { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.topbar-user-role { font-size: 0.75rem; color: var(--text-muted); }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 2rem;
    min-height: calc(100vh - var(--topbar-height));
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-left h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.page-header-left p { color: var(--text-secondary); font-size: 0.9rem; }

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244,162,97,0.1) 0%, transparent 70%);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.stat-card:hover::before { transform: scale(1.5); }

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon.blue   { background: rgba(79,134,198,0.15);  color: var(--info); }
.stat-icon.pink   { background: rgba(231,111,81,0.15);  color: var(--accent-secondary); }
.stat-icon.yellow { background: rgba(233,196,106,0.25); color: #b8860b; }
.stat-icon.green  { background: rgba(42,157,143,0.15);  color: var(--success); }
.stat-icon.purple { background: rgba(139,92,246,0.15);  color: var(--accent-purple); }
.stat-icon.red    { background: rgba(231,111,81,0.2);   color: var(--danger); }

.stat-trend {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

.stat-trend.up   { background: rgba(42,157,143,0.15);  color: var(--success); }
.stat-trend.down { background: rgba(231,111,81,0.15);  color: var(--danger); }

.stat-value { font-size: 2.2rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.35rem; line-height: 1; }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); }

/* ===== CARD ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.card:hover { border-color: rgba(244,162,97,0.4); }

.card-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(244,162,97,0.05) 0%, rgba(42,157,143,0.03) 100%);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i { color: var(--accent-secondary); }
.card-body { padding: 1.75rem; }
.p-0 { padding: 0 !important; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); color: #ffffff; }

.btn-secondary {
    background: #fff;
    color: var(--accent-secondary);
    border: 2px solid var(--accent-primary);
}
.btn-secondary:hover { background: var(--accent-primary); color: #fff; }

.btn-success { background: linear-gradient(135deg, var(--success), #21867a); color: #fff; }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(42,157,143,0.3); }

.btn-danger { background: linear-gradient(135deg, var(--danger), #d1573f); color: #fff; }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(231,111,81,0.3); }

.btn-warning { background: linear-gradient(135deg, var(--warning), #c98a1f); color: #fff; }

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; }

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }

.table th {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-tertiary) 100%);
    padding: 1rem 1.25rem;
    text-align: left;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.table td {
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr { transition: var(--transition); }
.table tbody tr:hover td { background: rgba(244,162,97,0.06); color: var(--text-primary); }
.table tbody tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: capitalize;
}

.badge-pending     { background: rgba(233,162,59,0.15);  color: #b8760a; }
.badge-in-process  { background: rgba(79,134,198,0.15);  color: var(--info); }
.badge-replied     { background: rgba(42,157,143,0.15);  color: var(--success); }
.badge-not-reply   { background: rgba(148,163,172,0.2);  color: var(--text-muted); }
.badge-draft       { background: rgba(139,92,246,0.15);  color: var(--accent-purple); }
.badge-sent        { background: rgba(42,157,143,0.15);  color: var(--success); }
.badge-delivered   { background: rgba(79,134,198,0.15);  color: var(--info); }
.badge-returned    { background: rgba(231,111,81,0.15);  color: var(--danger); }
.badge-critical    { background: rgba(231,111,81,0.2);   color: var(--danger); }
.badge-high        { background: rgba(233,162,59,0.2);   color: #b8760a; }
.badge-normal      { background: rgba(79,134,198,0.2);   color: var(--info); }
.badge-low         { background: rgba(42,157,143,0.2);   color: var(--success); }
.badge-admin       { background: rgba(231,111,81,0.2);   color: var(--danger); }
.badge-centre      { background: rgba(79,134,198,0.2);   color: var(--info); }
.badge-branch      { background: rgba(42,157,143,0.2);   color: var(--success); }
.badge-active      { background: rgba(42,157,143,0.15);  color: var(--success); }
.badge-inactive    { background: rgba(148,163,172,0.15); color: var(--text-muted); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fffdf7;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    appearance: none;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(244,162,97,0.2);
    background: #ffffff;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23e76f51' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-select option { background: #ffffff; color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 100px; }

.input-group { display: flex; gap: 0.5rem; }
.input-group .form-control { flex: 1; }

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.alert-success { background: rgba(42,157,143,0.1);  border: 1px solid rgba(42,157,143,0.3);  color: var(--success); }
.alert-danger  { background: rgba(231,111,81,0.1);  border: 1px solid rgba(231,111,81,0.3);  color: var(--danger); }
.alert-warning { background: rgba(233,162,59,0.12); border: 1px solid rgba(233,162,59,0.3);  color: #b8760a; }
.alert-info    { background: rgba(79,134,198,0.1);  border: 1px solid rgba(79,134,198,0.3);  color: var(--info); }

/* ============================================================
   MODALS - Light theme + guaranteed visible footer + scrolling
   ============================================================ */

.modal-content {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--border-radius-lg) !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: 90vh !important;
    overflow: hidden !important;
}

.modal-header {
    padding: 1.5rem !important;
    border-bottom: 1px solid var(--border-color) !important;
    background: linear-gradient(135deg, rgba(244,162,97,0.12) 0%, rgba(42,157,143,0.08) 100%) !important;
    flex-shrink: 0 !important;
}

.modal-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: var(--accent-secondary) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: var(--transition);
}

.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* SCROLLABLE BODY */
.modal-body {
    background: #ffffff !important;
    color: var(--text-secondary) !important;
    padding: 1.5rem !important;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

.modal-body label,
.modal-body .form-label {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

.modal-body .form-control,
.modal-body .form-select,
.modal-body textarea {
    background: #fffdf7 !important;
    border: 2px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.modal-body .form-control::placeholder,
.modal-body textarea::placeholder {
    color: var(--text-muted) !important;
    opacity: 1 !important;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus,
.modal-body textarea:focus {
    background: #ffffff !important;
    border-color: var(--accent-primary) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 0 3px rgba(244,162,97,0.2) !important;
}

.modal-body .form-select option {
    background: #ffffff !important;
    color: var(--text-primary) !important;
}

.modal-body .alert-info {
    background: rgba(79,134,198,0.1) !important;
    border: 1px solid rgba(79,134,198,0.3) !important;
    color: var(--info) !important;
}

.modal-body small {
    color: var(--text-muted) !important;
}

/* STICKY VISIBLE FOOTER WITH UPDATE BUTTON */
.modal-footer {
    background: #ffffff !important;
    border-top: 2px solid var(--border-color) !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 0.75rem !important;
    padding: 1.25rem 1.5rem !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 10 !important;
    box-shadow: 0 -4px 10px rgba(38,70,83,0.05) !important;
}

.modal-footer .btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 140px;
    justify-content: center;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: none !important;
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #ffb87a, #ff8163) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.modal-footer .btn-secondary {
    background: #ffffff !important;
    color: var(--accent-secondary) !important;
    border: 2px solid var(--accent-primary) !important;
}

.modal-footer .btn-secondary:hover {
    background: var(--accent-primary) !important;
    color: #ffffff !important;
}

/* ===== ROW STATUS COLORS ===== */
.row-overdue td { background: rgba(231,111,81,0.06) !important; }
.row-due-soon td { background: rgba(233,162,59,0.08) !important; }
.row-complete td { background: rgba(42,157,143,0.05) !important; }

/* ===== PROGRESS BAR ===== */
.progress-bar { height: 6px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); transition: width 1s ease; }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border-color); }
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-dot { position: absolute; left: -1.6rem; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-primary); box-shadow: 0 0 8px rgba(244,162,97,0.5); }
.timeline-content { background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 1rem; }
.timeline-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
.timeline-meta { font-size: 0.8rem; color: var(--text-muted); }

/* ===== FILE ATTACHMENT ITEM ===== */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.attachment-item:hover { border-color: var(--accent-primary); background: rgba(244,162,97,0.08); }

.attachment-icon { width: 40px; height: 40px; border-radius: var(--border-radius); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }

.attach-pdf   { background: rgba(231,111,81,0.15); color: var(--danger); }
.attach-img   { background: rgba(42,157,143,0.15); color: var(--success); }
.attach-word  { background: rgba(79,134,198,0.15); color: var(--info); }
.attach-excel { background: rgba(42,157,143,0.15); color: var(--success); }
.attach-file  { background: rgba(148,163,172,0.2); color: var(--text-muted); }

/* ===== FILTER TABS ===== */
.filter-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.filter-tab {
    padding: 0.5rem 1.1rem;
    border-radius: 20px;
    background: #ffffff;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.filter-tab:hover, .filter-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: var(--accent-primary);
    color: #ffffff;
}

/* ===== DROPDOWN MENU ===== */
.dropdown-menu { background: #ffffff; border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 0.5rem 0; box-shadow: var(--shadow); }
.dropdown-item { padding: 0.7rem 1.25rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; transition: var(--transition); }
.dropdown-item:hover { background: var(--bg-tertiary); color: var(--accent-secondary); }
.dropdown-divider { border-color: var(--border-color); margin: 0.35rem 0; }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #fff8e1 100%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(38,70,83,0.15);
    animation: slideUp 0.5s ease;
}

.login-header {
    padding: 2.5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-tertiary) 100%);
    border-bottom: 1px solid var(--border-color);
}

.login-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin: 0 auto 1.25rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.login-subtitle { color: rgba(255,255,255,0.85); font-size: 0.9rem; }
.login-body { padding: 2.5rem; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 10px rgba(244,162,97,0.3); } 50% { box-shadow: 0 0 25px rgba(244,162,97,0.6); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.animate-pulse { animation: pulse 2s infinite; }
.animate-spin  { animation: spin  1s linear infinite; }
.fade-in       { animation: fadeIn  0.5s ease; }
.slide-up      { animation: slideUp 0.5s ease; }

/* ===== UTILITY ===== */
.text-primary-color { color: var(--accent-secondary) !important; }
.text-secondary-clr  { color: var(--text-secondary) !important; }
.text-muted-clr      { color: var(--text-muted) !important; }
.text-success        { color: var(--success) !important; }
.text-danger         { color: var(--danger) !important; }
.text-warning        { color: #b8760a !important; }

.bg-card     { background: var(--bg-card) !important; }
.border-dark { border-color: var(--border-color) !important; }
.divider     { border-top: 1px solid var(--border-color); margin: 1.5rem 0; }
.text-center { text-align: center; }
.py-5        { padding-top: 3rem; padding-bottom: 3rem; }
.mt-3        { margin-top: 1rem; }
.me-2        { margin-right: 0.5rem; }
.ms-2        { margin-left: 0.5rem; }

/* ===== BOOTSTRAP GRID HELPERS ===== */
.row { display: flex; flex-wrap: wrap; margin: 0 -0.75rem; }
.row.g-3 > [class*="col-"] { padding: 0.5rem 0.75rem; }
.col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-12 { flex: 0 0 100%; max-width: 100%; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar { width: 70px; }
    .sidebar-logo .logo-text,
    .sidebar-logo .logo-sub,
    .nav-link span,
    .sidebar-user-name,
    .sidebar-user-role,
    .nav-section-label { display: none; }
    .sidebar-logo { padding: 1.5rem; justify-content: center; }
    .nav-link     { justify-content: center; padding: 1rem; }
    .topbar       { left: 70px; }
    .main-content { margin-left: 70px; }
    .sidebar-user { justify-content: center; }
}

@media (max-width: 768px) {
    .main-content { padding: 1rem; }
    .page-header  { flex-direction: column; align-items: flex-start; }
    .stats-grid   { grid-template-columns: 1fr 1fr; }
    .topbar       { padding: 0 1rem; }
    .search-wrapper { max-width: 200px; }
    .col-md-4, .col-md-6, .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .modal-content { max-height: 95vh !important; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .filter-tabs { overflow-x: auto; flex-wrap: nowrap; }
}