/* =========================================================
   Whiskey Company – Internal Theme
   Blue only. No green anywhere.
   Light / Dark mode via data-theme attribute
   ========================================================= */

:root {
    /* Light mode (default) */
    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --bg-sidebar: #0b1c33;
    --bg-header: #0d2137;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-on-dark: #e2e8f0;
    --accent: #1e40af;          /* Deep blue */
    --accent-hover: #1e3a8a;
    --accent-light: #3b82f6;
    --border: #cbd5e1;
    --success: #1e40af;         /* Still blue family */
    --danger: #b91c1c;
    --warning: #b45309;
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    --radius: 8px;
    --sidebar-width: 260px;
}

[data-theme="dark"] {
    --bg-body: #0b1220;
    --bg-card: #111827;
    --bg-sidebar: #020617;
    --bg-header: #020617;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-on-dark: #e2e8f0;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: #93c5fd;
    --border: #1e293b;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

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

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-on-dark);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sidebar-brand img {
    height: 36px;
    width: auto;
    display: block;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.sidebar-category {
    padding: 0.75rem 1.5rem 0.35rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: #cbd5e1;
    font-size: 0.92rem;
    transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(59, 130, 246, 0.15);
    color: #fff;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    opacity: 0.85;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top header bar */
.top-header {
    background: var(--bg-header);
    color: var(--text-on-dark);
    padding: 0.75rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-logo {
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
}

.header-logo img {
    height: 32px;
    width: auto;
    display: block;
}

.top-nav a {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-right: 1.25rem;
    transition: color 0.15s;
}
.top-nav a:hover { color: #fff; }

.top-header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.user-chip .ic-name {
    font-weight: 600;
    color: var(--accent-light);
}

.user-chip .role-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Theme toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #e2e8f0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
.theme-toggle:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-light);
}

/* Content area */
.page-content {
    padding: 1.75rem;
    flex: 1;
}

.page-title {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Tables */
.table-responsive { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table.data-table th,
table.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(30, 64, 175, 0.05);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table.data-table tr:hover td {
    background: rgba(59, 130, 246, 0.04);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-secondary:hover { background: rgba(59, 130, 246, 0.08); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #991b1b; }

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Alerts / Flash */
.alert {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.alert-success { background: rgba(30, 64, 175, 0.12); color: var(--accent); border: 1px solid rgba(30, 64, 175, 0.25); }
.alert-error   { background: rgba(185, 28, 28, 0.12); color: #b91c1c; border: 1px solid rgba(185, 28, 28, 0.25); }
.alert-info    { background: rgba(59, 130, 246, 0.1); color: var(--accent-light); border: 1px solid rgba(59, 130, 246, 0.25); }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-active   { background: rgba(30, 64, 175, 0.15); color: var(--accent); }
.badge-inactive { background: rgba(100, 116, 139, 0.15); color: #64748b; }
.badge-webmaster { background: rgba(30, 64, 175, 0.25); color: #1e3a8a; }
.badge-officer   { background: rgba(59, 130, 246, 0.2); color: #1d4ed8; }
.badge-user      { background: rgba(148, 163, 184, 0.2); color: #475569; }

/* Login page special */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0b1c33 0%, #0f2942 50%, #0b1c33 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    padding: 2.5rem;
}

.login-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Utility */
.text-muted { color: var(--text-secondary); }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* Responsive */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
}

/* Dashboard Notices */
.notice-card h2 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.6rem;
    margin-bottom: 1rem;
}

.notice-content h1,
.notice-content h2,
.notice-content h3,
.notice-content h4 {
    margin-top: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.notice-content p {
    margin: 0.6rem 0;
}

.notice-content ul,
.notice-content ol {
    margin: 0.6rem 0;
    padding-left: 1.4rem;
}

.notice-content code {
    background: rgba(59, 130, 246, 0.12);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.88em;
}

.notice-content pre {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.9rem 1rem;
    overflow-x: auto;
}

.notice-content a {
    text-decoration: underline;
}

/* Header dropdown for sub-links */
.top-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.top-nav > a,
.nav-item > a {
    color: #94a3b8;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.top-nav > a:hover,
.nav-item > a:hover {
    color: #fff;
    background: rgba(59, 130, 246, 0.15);
}

.nav-item {
    position: relative;
}

.nav-item.has-dropdown > a {
    cursor: pointer;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--bg-header);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
    padding: 0.4rem 0;
    z-index: 200;
}

.nav-item.has-dropdown:hover .nav-dropdown {
    display: block;
}

.nav-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    color: #cbd5e1;
    font-size: 0.88rem;
    white-space: nowrap;
}

.nav-dropdown a:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #fff;
}

/* WoW-style money display */
.money {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.money-gold,
.money-silver,
.money-copper {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.money-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    display: inline-block;
}

/* Greylist levels */
.grey-soft {
    color: #2563eb;
    font-weight: 700;
}
.grey-hard {
    color: #dc2626;
    font-weight: 700;
}
[data-theme="dark"] .grey-soft {
    color: #60a5fa;
}
[data-theme="dark"] .grey-hard {
    color: #f87171;
}

/* Frontpage blocks */
.frontpage-block-title {
    margin: 0 0 1rem;
    font-size: 1.35rem;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.6rem;
}
.frontpage-block-content {
    line-height: 1.65;
}

/* Sidebar user / IC switch panel */
.sidebar-user-panel {
    padding: 0.85rem 1.25rem;
    font-size: 0.75rem;
    color: #64748b;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.sidebar-user-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.2rem;
}
.sidebar-user-ic {
    font-weight: 700;
    font-size: 0.9rem;
    color: #93c5fd;
}
.sidebar-user-name {
    color: #94a3b8;
    margin-top: 0.15rem;
}
.sidebar-ic-select {
    width: 100%;
    margin-top: 0.35rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
}
.sidebar-ic-select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
}
.sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}
.sidebar-brand {
    flex-shrink: 0;
}
.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-bottom: 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,0.35) transparent;
}
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,0.35);
    border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}



/* ----- LOA row highlight (personnel table) ----- */
table.data-table tr.row-loa td {
    background: linear-gradient(
        90deg,
        rgba(185, 28, 28, 0.14) 0%,
        rgba(220, 38, 38, 0.08) 45%,
        rgba(185, 28, 28, 0.12) 100%
    ) !important;
    box-shadow: inset 3px 0 0 #b91c1c;
}

table.data-table tr.row-loa:hover td {
    background: linear-gradient(
        90deg,
        rgba(185, 28, 28, 0.22) 0%,
        rgba(220, 38, 38, 0.14) 45%,
        rgba(185, 28, 28, 0.18) 100%
    ) !important;
}

[data-theme="dark"] table.data-table tr.row-loa td {
    background: linear-gradient(
        90deg,
        rgba(239, 68, 68, 0.22) 0%,
        rgba(185, 28, 28, 0.12) 50%,
        rgba(239, 68, 68, 0.18) 100%
    ) !important;
    box-shadow: inset 3px 0 0 #ef4444;
}

[data-theme="dark"] table.data-table tr.row-loa:hover td {
    background: linear-gradient(
        90deg,
        rgba(239, 68, 68, 0.30) 0%,
        rgba(185, 28, 28, 0.18) 50%,
        rgba(239, 68, 68, 0.24) 100%
    ) !important;
}

.badge-loa {
    background: rgba(185, 28, 28, 0.18);
    color: #b91c1c;
}
[data-theme="dark"] .badge-loa {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
}
