/* =====================================================
   Break Management System - Main Styles
   ===================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --transition: 0.2s ease;
    --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    display: block;
}

/* ========== AUTH PAGES ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    padding: 24px;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-card-wide {
    max-width: 520px;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #fff;
    font-size: 28px;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== FORMS ========== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon > i:first-child {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 44px 12px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    font-size: 0.95rem;
    transition: color var(--transition);
}
.toggle-password:hover {
    color: var(--primary);
}

.form-styled input[type="text"],
.form-styled input[type="tel"],
.form-styled input[type="password"],
.form-styled input[type="email"],
.form-styled select,
.form-styled textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-styled input:focus,
.form-styled select:focus,
.form-styled textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.field-error {
    font-size: 0.8rem;
    color: var(--danger);
    display: none;
}
.field-error.show {
    display: block;
}

.field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s, box-shadow var(--transition);
    text-decoration: none;
    line-height: 1.3;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-secondary {
    background: #e2e8f0;
    color: var(--text);
}
.btn-secondary:hover {
    background: #cbd5e1;
    color: var(--text);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loader {
    display: inline-flex;
}

/* ========== ALERTS ========== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #a5f3fc;
}

/* ========== APP LAYOUT ========== */
.app-body {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.sidebar-logo i {
    font-size: 1.3rem;
    color: var(--primary-light);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

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

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    margin-bottom: 2px;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

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

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: #f87171;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition);
}
.sidebar-logout:hover {
    background: rgba(248,113,113,0.12);
    color: #fca5a5;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

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

/* Top header */
.top-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

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

.header-icon-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    font-size: 1.1rem;
}
.header-icon-btn:hover {
    background: var(--bg);
    color: var(--primary);
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.user-menu-trigger:hover {
    background: var(--bg);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.user-menu-trigger .fa-chevron-down {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    z-index: 200;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 0.9rem;
    transition: background var(--transition);
}
.user-dropdown a:hover {
    background: var(--bg);
    color: var(--primary);
}

/* Page content */
.page-content {
    flex: 1;
    padding: 24px;
}

/* ========== DASHBOARD ========== */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.welcome-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.welcome-block h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.welcome-date {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}

.bg-primary { background: var(--primary); }
.bg-success { background: var(--success); }
.bg-info    { background: var(--info); }
.bg-warning { background: var(--warning); }

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}

.stat-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.section-card .card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.section-card .card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-card .card-header h3 i {
    color: var(--primary);
}

.section-card .card-body {
    padding: 22px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 360px;
    margin: 0 auto;
    display: block;
}

/* Profile */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.profile-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.profile-value {
    font-size: 1rem;
    font-weight: 600;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }

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

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

.data-table th {
    text-align: left;
    padding: 12px 14px;
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.actions-cell {
    display: flex;
    gap: 6px;
}

.btn-icon-sm {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: var(--bg);
    transition: background var(--transition), color var(--transition);
    font-size: 0.9rem;
}
.btn-icon-sm:hover {
    background: var(--primary);
    color: #fff;
}

.page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Info list */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.text-success { color: var(--success); }
.text-muted   { color: var(--text-muted); }

/* ========== CLOCK ========== */
.clock-card {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 0;
    border: none;
    background: linear-gradient(145deg, #0b1220 0%, #132337 40%, #1a3a5c 100%);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
}

.clock-glow {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.clock-inner {
    position: relative;
    padding: 36px 24px 32px;
}

.clock-date {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.85);
    margin-bottom: 10px;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}

.clock-time {
    font-size: 3.4rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    color: #f8fafc;
    text-shadow: 0 0 30px rgba(56, 189, 248, 0.35);
    font-family: 'Segoe UI', system-ui, -apple-system, monospace;
}

.clock-tz {
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.9);
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.card-header-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== SLOTS GRID ========== */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.slot-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: box-shadow var(--transition), border-color var(--transition);
    background: #fff;
}

.slot-card:hover {
    box-shadow: var(--shadow-md);
}

.slot-free {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.slot-booked {
    border-color: #fecaca;
    background: #fef2f2;
}

.slot-mine {
    border-color: #93c5fd;
    background: #eff6ff;
}

.slot-time {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.slot-time i {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.slot-user {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 20px;
}

.slot-free-label {
    color: var(--success);
    font-weight: 600;
}

.slot-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fee2e2;
    color: #991b1b;
}

.slot-badge.muted {
    background: #f1f5f9;
    color: #94a3b8;
}

.slot-btn {
    width: 100%;
    margin-top: 4px;
}

.slot-form {
    width: 100%;
}

/* Clickable admin cards */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.15s ease, box-shadow var(--transition);
}
.card-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: inherit;
}
.card-link .stat-card {
    height: 100%;
}

/* ========== BOOK FORM ========== */
.book-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.book-select-wrap {
    flex: 1;
    min-width: 180px;
}

.select-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.select-with-icon > i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.9rem;
}

.select-with-icon select {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.select-with-icon select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.book-btn-wrap {
    display: flex;
    flex-direction: column;
}

.book-btn-label {
    font-size: 0.875rem;
    font-weight: 600;
    visibility: hidden;
}

.btn-book {
    padding: 12px 28px;
    font-size: 1rem;
    white-space: nowrap;
}

/* ========== BOOKED LIST ========== */
.booked-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.booked-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    transition: box-shadow var(--transition);
}

.booked-item:hover {
    box-shadow: var(--shadow);
}

.booked-mine {
    border-color: #93c5fd;
    background: #eff6ff;
}

.booked-past {
    opacity: 0.72;
}

.booked-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.booked-mine .booked-avatar {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}

.booked-past .booked-avatar {
    background: linear-gradient(135deg, #94a3b8, #cbd5e1);
}

.booked-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.booked-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.booked-you {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: #dbeafe;
    color: #1e40af;
}

.booked-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.booked-time {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: var(--bg);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
}

.booked-time i {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.booked-past .booked-time {
    color: var(--text-muted);
}
