/* ══════════════════════════════════════════════════
   Theme: HR Management Dashboard (Warm Cream/Gold)
   Scope: body.dashboard-page only
   ══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
body.dashboard-page,
body.login-page {
    --primary: #D4A843;
    --primary-light: #F5ECD4;
    --primary-hover: #C49B35;
    --accent: #E8D44D;
    --page-bg: #F2EDE4;
    --card-bg: #FFFFFF;
    --card-radius: 20px;
    --dark-bg: #1A1A1A;
    --text-primary: #1A1A1A;
    --text-secondary: #6B6B6B;
    --text-muted: #9B9B9B;
    --border-color: #EBE6DD;
    --shadow: 0 2px 8px rgba(0,0,0,.04);
    --shadow-hover: 0 8px 24px rgba(0,0,0,.08);
}

/* ── Base ── */
body.dashboard-page,
body.login-page {
    background: var(--page-bg);
    background-image: none;
    font-family: 'Inter', 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
}

/* ══════════ NAVBAR ══════════ */
body.dashboard-page .navbar {
    background: var(--page-bg) !important;
    border-bottom: none !important;
    box-shadow: none;
    padding: 1rem 1.5rem;
}
body.dashboard-page .navbar > .container-fluid {
    background: var(--card-bg);
    border-radius: 50px;
    padding: 0.5rem 0.6rem;
    box-shadow: var(--shadow);
}
body.dashboard-page .navbar .navbar-brand {
    color: var(--text-primary) !important;
    font-weight: 700;
    font-size: 0;
    padding: 0.4rem 0.8rem;
}
body.dashboard-page .navbar .navbar-brand img {
    width: 32px;
    height: 32px;
}
body.dashboard-page .navbar .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.55rem 1.1rem !important;
    border-radius: 50px;
    transition: all 0.25s ease;
    margin: 0 1px;
}
body.dashboard-page .navbar .nav-link:hover,
body.dashboard-page .navbar .nav-link:focus {
    color: var(--text-primary) !important;
    background: var(--primary-light) !important;
}
body.dashboard-page .navbar .nav-link.active {
    color: #fff !important;
    background: var(--dark-bg) !important;
    font-weight: 600;
}
body.dashboard-page .navbar .styleUserName {
    color: var(--text-primary) !important;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.3rem 0;
}
body.dashboard-page .navbar .btn-danger {
    background: var(--dark-bg);
    border: none;
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
body.dashboard-page .navbar .btn-danger:hover {
    background: #333;
}
body.dashboard-page .navbar .navbar-toggler {
    border: none;
    padding: 0.4rem;
}

/* ══════════ CARD BASE ══════════ */
body.dashboard-page .card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    --bs-card-border-color: transparent;
    background: var(--card-bg);
}
body.dashboard-page .card:hover {
    box-shadow: var(--shadow-hover);
}
body.dashboard-page .card-header {
    background: var(--card-bg);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* ══════════ WELCOME SECTION ══════════ */
.dashboard-welcome {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0;
}
.dashboard-welcome:hover {
    box-shadow: none !important;
}
.welcome-content {
    padding: 0.5rem 0.25rem 1rem;
}
.welcome-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
    font-family: 'Inter', sans-serif;
}
.welcome-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.25rem;
}
.welcome-date {
    display: none;
}

/* ══════════ SIDEBAR ══════════ */
body.dashboard-page .sidebar-wrapper {
    position: sticky;
    top: 1rem;
}

/* ── Sidebar menus ── */
body.dashboard-page .sidebar-menu {
    border: none !important;
    border-radius: var(--card-radius) !important;
    overflow: hidden;
}
body.dashboard-page .sidebar-menu .card-header {
    background: var(--card-bg);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.9rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
body.dashboard-page .sidebar-menu .card-header i {
    color: var(--text-muted);
    font-size: 0.9rem;
}
body.dashboard-page .sidebar-menu .list-group-item {
    border: none;
    border-bottom: 1px solid #F5F1EB;
    padding: 0.7rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}
body.dashboard-page .sidebar-menu .list-group-item:hover {
    background: var(--primary-light);
    color: var(--primary-hover);
    padding-left: 1.5rem;
}
body.dashboard-page .sidebar-menu .list-group-item:last-child {
    border-bottom: none;
}
body.dashboard-page .list-group-item.active {
    background: var(--primary);
    border-color: transparent;
    color: #fff;
}

/* ── Quick menu: การ์ดลิงก์ในกรอบ content-card แยกกลุ่ม (กิจกรรม/ข่าวประชาสัมพันธ์/ผลงานนิสิต) ── */
.db-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}
@media (max-width: 1199.98px) {
    .db-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767.98px) {
    .db-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 479.98px) {
    .db-grid { grid-template-columns: 1fr; }
}
.db-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--page-bg);
    transition: all 0.2s ease;
}
.db-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    color: var(--text-primary);
}
.db-card:hover .db-card-ico {
    background: var(--db-accent, var(--primary));
    color: #fff;
}
.db-card:hover .db-card-go {
    opacity: 1;
    color: var(--db-accent, var(--primary));
}
.db-card-ico {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--db-accent, var(--primary));
    transition: all 0.2s ease;
}
.db-card-title {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
}
.db-card-go {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.45;
    transition: all 0.2s ease;
}
.db-empty {
    grid-column: 1 / -1;
    padding: 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--page-bg);
    border-radius: 14px;
}

/* ── System status in sidebar ── */
.sidebar-status {
    border-radius: var(--card-radius) !important;
    border: none !important;
}
.sidebar-status .status-header {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sidebar-status .status-header i {
    color: var(--primary);
}
.sidebar-status .status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.15rem;
}
.sidebar-status .status-row + .status-row {
    border-top: 1px solid var(--border-color);
}
.sidebar-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sidebar-status .status-dot-blue  { background: #5B8DEF; }
.sidebar-status .status-dot-green { background: #4CAF50; }
.sidebar-status .status-dot-red   { background: #EF4444; }
.sidebar-status .status-info {
    flex: 1;
    min-width: 0;
}
.sidebar-status .status-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}
.sidebar-status .status-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ══════════ STAT CARDS ══════════ */
.stat-card {
    border: none !important;
    border-radius: var(--card-radius) !important;
    background: var(--card-bg);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover) !important;
}
.stat-card .card-body {
    padding: 1.25rem 1.25rem !important;
    text-align: left !important;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.stat-card .stat-info {
    flex: 1;
    min-width: 0;
}
.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-card .stat-number {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    font-family: 'Inter', sans-serif;
}

/* Stat card variants */
.stat-card-blue .stat-icon  { background: #EBF0FF; color: #5B8DEF; }
.stat-card-green .stat-icon { background: #E6F7ED; color: #4CAF50; }
.stat-card-cyan .stat-icon  { background: #E0F7FA; color: #26A69A; }
.stat-card-purple .stat-icon { background: #F3E8FF; color: #9C67E0; }

/* ══════════ CONTENT CARDS ══════════ */
body.dashboard-page .content-card {
    border: none;
    border-radius: var(--card-radius) !important;
}
body.dashboard-page .content-card .card-header {
    background: var(--card-bg);
    font-weight: 700;
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* ══════════ TABLE ══════════ */
body.dashboard-page .table {
    --bs-table-bg: transparent;
    margin: 0;
}
body.dashboard-page .table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}
body.dashboard-page .table td {
    border-color: #F5F1EB;
    vertical-align: middle;
    padding: 0.65rem 1rem;
    font-size: 0.86rem;
    color: var(--text-secondary);
}
body.dashboard-page .table td a:not(.btn) {
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.15s ease;
}
body.dashboard-page .table td a:not(.btn):hover {
    color: var(--primary-hover);
}
body.dashboard-page .table-hover tbody tr:hover {
    background: #FDFBF7;
}
body.dashboard-page .table-light,
body.dashboard-page thead.table-light {
    --bs-table-bg: #FDFBF7;
}

/* ══════════ BADGE ══════════ */
body.dashboard-page .badge {
    border-radius: 50px;
    font-weight: 600;
    padding: 0.35em 0.75em;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}
body.dashboard-page .badge.bg-success {
    background: #E6F7ED !important;
    color: #2E7D32;
}
body.dashboard-page .badge.bg-secondary {
    background: #F0EDE7 !important;
    color: var(--text-muted);
}
body.dashboard-page .badge.bg-info {
    background: var(--primary-light) !important;
    color: var(--primary-hover);
}

/* ══════════ BUTTONS ══════════ */
body.dashboard-page .btn-info {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    border-radius: 50px;
    font-weight: 500;
}
body.dashboard-page .btn-info:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}
body.dashboard-page .btn-outline-secondary {
    border-radius: 50px;
    border-color: var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
}
body.dashboard-page .btn-outline-secondary:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-hover);
}
body.dashboard-page .btn-success {
    background: #4CAF50;
    border-color: #4CAF50;
    border-radius: 50px;
}
body.dashboard-page .btn-secondary {
    background: var(--text-muted);
    border-color: var(--text-muted);
    border-radius: 50px;
}

/* ══════════ DROPDOWN ══════════ */
body.dashboard-page .dropdown-menu {
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    padding: 0.5rem;
}
body.dashboard-page .dropdown-item {
    border-radius: 10px;
    font-size: 0.86rem;
}
body.dashboard-page .dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary-hover);
}

/* ══════════ DATATABLE OVERRIDE ══════════ */
body.dashboard-page .dataTables_wrapper .dataTables_filter input {
    border-radius: 50px;
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    font-size: 0.85rem;
}
body.dashboard-page .dataTables_wrapper .dataTables_length select {
    border-radius: 10px;
    border: 1px solid var(--border-color);
}
body.dashboard-page .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 10px !important;
    border: none !important;
}
body.dashboard-page .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--dark-bg) !important;
    color: #fff !important;
    border: none !important;
}
body.dashboard-page .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-light) !important;
    color: var(--primary-hover) !important;
    border: none !important;
}

/* ══════════ PHOTO THUMBS ══════════ */
body.dashboard-page .photo-thumb {
    border-radius: 16px !important;
    overflow: hidden;
    border: none !important;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}
body.dashboard-page .photo-thumb:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
body.dashboard-page .photo-thumb .card-body {
    padding: 0.6rem !important;
}

/* ══════════ STATUS ICONS ══════════ */
.status-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.status-icon-blue  { background: #EBF0FF; color: #5B8DEF; }
.status-icon-green { background: #E6F7ED; color: #4CAF50; }
.status-icon-red   { background: #FEEBEB; color: #EF4444; }

/* ══════════ FOOTER ══════════ */
body.dashboard-page .dashboard-footer {
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 1.5rem 0 0.5rem;
    font-weight: 400;
}

/* ══════════ SCROLLBAR ══════════ */
body.dashboard-page ::-webkit-scrollbar       { width: 5px; height: 5px; }
body.dashboard-page ::-webkit-scrollbar-track  { background: transparent; }
body.dashboard-page ::-webkit-scrollbar-thumb  { background: #D5CFC5; border-radius: 10px; }
body.dashboard-page ::-webkit-scrollbar-thumb:hover { background: #B0A898; }

/* ══════════ ANIMATIONS ══════════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
body.dashboard-page .stat-card,
body.dashboard-page .content-card,
body.dashboard-page .sidebar-menu,
body.dashboard-page .sidebar-status,
body.login-page .login-card {
    animation: fadeInUp 0.4s ease forwards;
}

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 991.98px) {
    .welcome-title { font-size: 1.5rem; }
    .stat-card .stat-number { font-size: 1.3rem; }
    body.dashboard-page .navbar > .container-fluid {
        border-radius: 20px;
    }
}
@media (max-width: 575.98px) {
    .welcome-title { font-size: 1.25rem; }
    .stat-card .stat-number { font-size: 1.1rem; }
    .stat-card .card-body { padding: 1rem !important; }
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 0.95rem; }
}

/* ══════════ LOGIN PAGE ══════════ */
body.login-page { min-height: 100vh; }
body.login-page .navbar {
    background: var(--page-bg) !important;
    border-bottom: none !important;
    box-shadow: none;
    padding: 1rem 1.5rem;
}
body.login-page .navbar > .container-fluid {
    background: var(--card-bg);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow);
}
body.login-page .navbar .navbar-brand {
    color: var(--text-primary) !important;
    font-weight: 700;
    font-size: 0.92rem;
}
body.login-page .navbar .navbar-brand img { width: 32px; height: 32px; }

/* ── Login Card ── */
body.login-page .login-card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    --bs-card-border-color: transparent;
    background: var(--card-bg);
    transition: box-shadow 0.3s ease;
}
body.login-page .login-card:hover {
    box-shadow: var(--shadow-hover);
}
body.login-page .login-card .card-header {
    background: var(--dark-bg);
    color: #fff;
    border-bottom: none;
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    padding: 1.4rem 1.5rem;
}
body.login-page .login-card .card-header .stylePanel1 {
    color: #fff;
    font-size: 1.1rem;
}
body.login-page .login-card .card-body {
    padding: 2rem 2.5rem;
}

/* ── Login Form ── */
body.login-page .input-group-text {
    background: var(--primary-light);
    border: 1px solid var(--border-color);
    border-right: none;
    color: var(--primary);
    border-radius: 50px 0 0 50px;
    padding: 10px 14px;
}
body.login-page .form-control {
    border: 1px solid var(--border-color);
    border-radius: 0 50px 50px 0;
    padding: 10px 14px;
    font-size: 0.92rem;
}
body.login-page .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212,168,67,.15);
}
body.login-page .btn-login {
    background: var(--dark-bg);
    border: none;
    border-radius: 50px;
    padding: 11px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    transition: all 0.2s ease;
}
body.login-page .btn-login:hover {
    background: #333;
    transform: translateY(-1px);
    color: #fff;
}
body.login-page .login-footer {
    color: var(--text-muted);
    font-size: .78rem;
}
