/* =============================================
   Restaurant Dashboard - Pastel Theme
   ธีมสี: เขียวพาสเทล + ม่วงพาสเทล
   ============================================= */

:root {
    /* พาเลทสีหลัก - Pastel */
    --green-light: #d1fae5;
    --green-soft: #a7f3d0;
    --green-main: #6ee7b7;
    --green-dark: #34d399;
    --green-deep: #10b981;
    
    --purple-light: #f3e8ff;
    --purple-soft: #e9d5ff;
    --purple-main: #c4b5fd;
    --purple-dark: #a78bfa;
    --purple-deep: #8b5cf6;
    
    --blue-soft: #dbeafe;
    --blue-main: #93c5fd;
    
    --bg-gradient-start: #f0fdf4;
    --bg-gradient-end: #faf5ff;
    
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

/* =============================================
   LOGIN PAGE
   ============================================= */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--purple-soft) 0%, var(--green-soft) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

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

.logo {
    font-size: 48px;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--purple-deep);
    margin-bottom: 8px;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--green-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.btn-primary {
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--purple-dark) 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.btn-link {
    color: var(--purple-deep);
    text-decoration: none;
    font-weight: 600;
}

@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group input:focus {
    outline: none;
    border-color: var(--purple-main);
    box-shadow: 0 0 0 3px var(--purple-soft);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--green-deep) 0%, var(--purple-deep) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--green-light);
}

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

/* =============================================
   ALERTS
   ============================================= */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

/* =============================================
   DASHBOARD LAYOUT
   ============================================= */

.dashboard-page {
    min-height: 100vh;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.tab-bar {
    display: flex;
    gap: 10px;
    margin: 8px 0 20px 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.tab-btn {
    border: 0;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(167, 243, 208, 0.55) 0%, rgba(221, 214, 254, 0.55) 100%);
    color: var(--purple-deep);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 3;
    pointer-events: auto;
    user-select: none;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(110, 231, 183, 0.65);
}

.tab-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.10);
    background: linear-gradient(135deg, rgba(167, 243, 208, 0.75) 0%, rgba(221, 214, 254, 0.75) 100%);
}

.tab-btn.is-active {
    background: linear-gradient(135deg, var(--green-main) 0%, var(--purple-main) 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.25);
}

.tab-btn:active {
    transform: translateY(1px);
}

.tab-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--purple-soft);
}

.table-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    margin: 10px 0 14px 0;
}

.table-search {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    border: 2px solid var(--green-light);
    border-radius: var(--radius-md);
    font-family: inherit;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--purple-soft) 0%, var(--green-light) 100%);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
}

.sidebar-header .logo {
    font-size: 40px;
    margin-bottom: 8px;
}

.sidebar-header h2 {
    font-size: 18px;
    color: var(--purple-deep);
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    color: var(--text-dark);
    text-decoration: none;
    margin-bottom: 8px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.5);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--purple-main) 0%, var(--green-main) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.nav-item .icon {
    font-size: 20px;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-logout {
    display: block;
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #dc2626;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--green-light);
}

.header-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--purple-deep);
    margin-bottom: 4px;
}

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

.header-info {
    text-align: right;
}

.last-update {
    background: var(--purple-light);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--purple-deep);
}

/* =============================================
   SUMMARY CARDS
   ============================================= */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-highlight {
    background: linear-gradient(135deg, var(--purple-main) 0%, var(--green-main) 100%);
    color: white;
}

.card-highlight h3 {
    color: rgba(255, 255, 255, 0.9);
}

.card-purple {
    border-left: 4px solid var(--purple-deep);
}

.card-purple .card-icon {
    background: var(--purple-soft);
    color: var(--purple-deep);
}

.card-green {
    border-left: 4px solid var(--green-deep);
}

.card-green .card-icon {
    background: var(--green-light);
    color: var(--green-deep);
}

.card-blue {
    border-left: 4px solid var(--blue-main);
}

.card-blue .card-icon {
    background: var(--blue-soft);
    color: #3b82f6;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.card-highlight .card-icon {
    background: rgba(255, 255, 255, 0.2);
}

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

.card-highlight .card-content h3 {
    color: rgba(255, 255, 255, 0.9);
}

.card-content .amount {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-content .detail {
    font-size: 13px;
    color: var(--text-light);
}

.card-highlight .card-content .detail {
    color: rgba(255, 255, 255, 0.8);
}

/* =============================================
   CONTENT SECTIONS
   ============================================= */

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.card-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--purple-deep);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--green-light);
}

.chart-container {
    height: 300px;
    position: relative;
}

/* =============================================
   TABLES
   ============================================= */

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: linear-gradient(135deg, var(--green-light) 0%, var(--purple-light) 100%);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--purple-deep);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table th.text-right {
    text-align: right;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--green-light);
}

.data-table tbody tr:hover {
    background: rgba(167, 243, 208, 0.3);
}

.data-table .text-right {
    text-align: right;
}

.data-table .amount {
    font-weight: 600;
    color: var(--purple-deep);
}

.row-today {
    background: linear-gradient(135deg, var(--purple-soft) 0%, var(--green-soft) 100%) !important;
    font-weight: 600;
}

.row-today td {
    border-bottom: 2px solid var(--purple-main);
}

.badge-today {
    background: var(--purple-deep);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    margin-left: 8px;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1200px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .header-info {
        text-align: left;
    }
}
