/* =============================================
   JobMatch Admin System - Main Stylesheet
   Premium Dark Theme with Glassmorphism
   ============================================= */

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

/* CSS Variables */
:root {
    --bg-primary: #FEF6F1;
    --bg-secondary: #FBF4EF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FFFFFF;
    --bg-glass: rgba(35, 31, 32, 0.02);
    --bg-glass-border: #EFE2D8;
    --bg-sidebar: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-input-focus: #FFFFFF;
    
    --accent-primary: #1287B5;
    --accent-secondary: #45CBF3;
    --accent-gradient: linear-gradient(135deg, #0B6A90 0%, #1287B5 55%, #2BA9D8 100%);
    --accent-gradient-hover: linear-gradient(135deg, #095a7a 0%, #0f76a0 55%, #2398c4 100%);
    --accent-glow: rgba(18, 135, 181, 0.22);
    
    --text-primary: #231F20;
    --text-secondary: #6B625C;
    --text-muted: #9A8F88;
    --text-white: #231F20;
    
    --success: #2E9E6A;
    --success-bg: rgba(46, 158, 106, 0.1);
    --warning: #C77A12;
    --warning-bg: rgba(242, 154, 46, 0.12);
    --danger: #E5484D;
    --danger-bg: rgba(229, 72, 77, 0.1);
    --info: #1287B5;
    --info-bg: rgba(69, 203, 243, 0.14);
    
    --border-color: #EFE2D8;
    --border-light: #E5D5C9;
    
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --topbar-height: 70px;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-round: 50%;
    
    --shadow-sm: 0 2px 8px rgba(35, 31, 32, 0.05);
    --shadow-md: 0 4px 20px rgba(35, 31, 32, 0.07);
    --shadow-lg: 0 8px 40px rgba(35, 31, 32, 0.12);
    --shadow-glow: 0 0 30px var(--accent-glow);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(18, 135, 181, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(69, 203, 243, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(69, 203, 243, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-medium);
    backdrop-filter: blur(20px);
}

.sidebar-brand {
    padding: 24px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 80px;
}

.sidebar-brand .brand-icon {
    width: 42px;
    height: 42px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.sidebar-brand .brand-text h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.3px;
}

.sidebar-brand .brand-text span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

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

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    padding: 0 16px;
    margin-bottom: 8px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(18, 135, 181, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(18, 135, 181, 0.15);
    color: var(--accent-secondary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    width: 22px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-footer .admin-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.sidebar-footer .admin-info:hover {
    background: rgba(35, 31, 32, 0.03);
}

.sidebar-footer .admin-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-round);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sidebar-footer .admin-details h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-footer .admin-details span {
    font-size: 11px;
    color: var(--text-muted);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(254, 246, 241, 0.88);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.3px;
}

.topbar-left .breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-left .breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.topbar-left .breadcrumb a:hover {
    color: var(--accent-secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.topbar-btn:hover {
    background: rgba(18, 135, 181, 0.1);
    color: var(--accent-secondary);
    border-color: rgba(18, 135, 181, 0.3);
}

.topbar-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

/* แผงแจ้งเตือนกิจกรรมล่าสุด */
.noti-wrapper {
    position: relative;
}

.noti-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 200;
}

.noti-panel.open {
    display: block;
}

.noti-panel-header {
    padding: 14px 18px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.noti-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 18px;
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.noti-item:last-child {
    border-bottom: none;
}

.noti-item:hover {
    background: var(--bg-secondary);
}

.noti-item.is-new {
    background: var(--info-bg);
}

.noti-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--info-bg);
    color: var(--accent-primary);
    font-size: 14px;
}

.noti-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.noti-text strong {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.noti-text small {
    font-size: 12px;
    color: var(--text-muted);
}

.noti-empty {
    padding: 24px 18px;
    text-align: center;
    color: var(--text-muted);
}

.page-content {
    padding: 32px;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: all var(--transition-medium);
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .stat-info h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .stat-info .stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-card .stat-info .stat-change {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card .stat-info .stat-change.up {
    color: var(--success);
}

.stat-card .stat-info .stat-change.down {
    color: var(--danger);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.purple {
    background: rgba(18, 135, 181, 0.15);
    color: var(--accent-secondary);
}

.stat-icon.teal {
    background: rgba(46, 158, 106, 0.15);
    color: var(--success);
}

.stat-icon.orange {
    background: rgba(242, 154, 46, 0.15);
    color: var(--warning);
}

.stat-icon.blue {
    background: rgba(69, 203, 243, 0.15);
    color: var(--info);
}

.stat-icon.red {
    background: rgba(229, 72, 77, 0.15);
    color: var(--danger);
}

/* =============================================
   TABLES
   ============================================= */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-card);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(18, 135, 181, 0.05);
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* =============================================
   BADGES & STATUS
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(46, 158, 106, 0.2);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(242, 154, 46, 0.2);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(229, 72, 77, 0.2);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(69, 203, 243, 0.2);
}

.badge-default {
    background: rgba(35, 31, 32, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Kanit', sans-serif;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    outline: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 25px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-success {
    background: rgba(46, 158, 106, 0.15);
    color: var(--success);
    border: 1px solid rgba(46, 158, 106, 0.3);
}

.btn-success:hover {
    background: rgba(46, 158, 106, 0.25);
}

.btn-warning {
    background: rgba(242, 154, 46, 0.15);
    color: var(--warning);
    border: 1px solid rgba(242, 154, 46, 0.3);
}

.btn-warning:hover {
    background: rgba(242, 154, 46, 0.25);
}

.btn-danger {
    background: rgba(229, 72, 77, 0.15);
    color: var(--danger);
    border: 1px solid rgba(229, 72, 77, 0.3);
}

.btn-danger:hover {
    background: rgba(229, 72, 77, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* =============================================
   FORMS
   ============================================= */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Kanit', sans-serif;
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    background: var(--bg-input-focus);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B625C' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    color-scheme: light; /* ให้รายการตัวเลือกที่เบราว์เซอร์วาดเองเป็นโทนสว่างตามธีม */
}

/* รายการตัวเลือกใน dropdown: พื้นขาว ตัวอักษรสีหมึก ตามธีมสว่าง */
select option,
select optgroup {
    background-color: #FFFFFF;
    color: #231F20;
}

select option:checked {
    background-color: #1287B5;
    color: #ffffff;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Search Bar */
.search-box {
    position: relative;
    max-width: 320px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Kanit', sans-serif;
    transition: all var(--transition-fast);
    outline: none;
}

.search-box input:focus {
    background: var(--bg-input-focus);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

/* =============================================
   TABS
   ============================================= */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-item {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: 'Kanit', sans-serif;
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item.active {
    color: var(--accent-secondary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(35, 31, 32, 0.45);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 24px 28px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(229, 72, 77, 0.1);
    color: var(--danger);
}

.modal-body {
    padding: 24px 28px;
}

.modal-footer {
    padding: 16px 28px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.pagination a, .pagination span {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.pagination a:hover {
    background: rgba(18, 135, 181, 0.15);
    color: var(--accent-secondary);
    border-color: rgba(18, 135, 181, 0.3);
}

.pagination .active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(46, 158, 106, 0.2);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(229, 72, 77, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(242, 154, 46, 0.2);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(69, 203, 243, 0.2);
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    backdrop-filter: blur(20px);
    animation: fadeIn 0.6s ease;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header .login-icon {
    width: 64px;
    height: 64px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-glow);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-control {
    padding: 14px 16px;
    font-size: 15px;
}

.login-form .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    justify-content: center;
    margin-top: 8px;
}

/* =============================================
   GRID LAYOUTS
   ============================================= */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* =============================================
   CHARTS
   ============================================= */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* =============================================
   USER/ITEM ROW
   ============================================= */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-round);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-avatar.green { background: linear-gradient(135deg, #2E9E6A, #5CC08F); }
.user-avatar.orange { background: linear-gradient(135deg, #F29A2E, #F6B866); }
.user-avatar.blue { background: linear-gradient(135deg, #45CBF3, #1287B5); }
.user-avatar.red { background: linear-gradient(135deg, #E5484D, #F07A6E); }

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 14px;
}

/* =============================================
   FILTER BAR
   ============================================= */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    width: auto;
    min-width: 160px;
}

/* =============================================
   DETAIL VIEW
   ============================================= */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-item {
    padding: 12px 0;
}

.detail-item .detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-item .detail-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress-bar {
    height: 8px;
    background: rgba(35, 31, 32, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width var(--transition-slow);
}

/* =============================================
   TOAST
   ============================================= */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    font-size: 14px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }

/* =============================================
   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(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease;
}

.animate-slide-up {
    animation: slideUp 0.5s ease;
}

/* Stagger children animation */
.stagger-children > * {
    animation: slideUp 0.4s ease backwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

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

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-toggle {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-content {
        padding: 20px 16px;
    }
    
    .topbar {
        padding: 0 16px;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar .form-control,
    .filter-bar .search-box {
        max-width: 100%;
        width: 100%;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* =============================================
   UTILITY CLASSES
   ============================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }
.hidden { display: none; }
.mobile-toggle { display: none; }

/* โลโก้ JobMatch (ไอคอน JM) ในแถบเมนูและหน้าล็อกอิน */
/* กรอบไอคอนเดิมเป็นพื้นไล่สี ตอนนี้ใช้รูปโลโก้ที่มีพื้นสีหมึกในตัว จึงเอาพื้นหลังและเงาเรืองแสงออก */
.sidebar-brand .brand-icon, .login-header .login-icon {
    background: none;
    box-shadow: none;
}
.brand-icon img, .login-icon img {
    width: 100%;
    height: 100%;
    display: block;
}
/* คำว่า "Match" ในชื่อแบรนด์ เป็น <span> ใน h2 จึงต้องกันไม่ให้โดนสไตล์ของ .brand-text span (ตัวเล็กพิมพ์ใหญ่ของ "Admin Panel") */
.sidebar-brand .brand-text h2 .brand-accent,
.brand-accent {
    color: var(--accent-primary);
    font-size: inherit;
    font-weight: inherit;
    text-transform: none;
    letter-spacing: inherit;
}
