/* ═══════════════════════════════════════════════════════
   timz.au — Core Design System
   Aesthetic: Editorial confidence, refined geometry
   Fonts: Outfit (display) + DM Sans (body)
   ═══════════════════════════════════════════════════════ */

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

:root {
    /* Brand */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-bg: #eff6ff;

    /* Semantic */
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #0891b2;
    --info-light: #cffafe;

    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --dark: #0f1724;

    /* Layout */
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow: 0 1px 3px rgba(15,23,36,0.05), 0 1px 2px rgba(15,23,36,0.03);
    --shadow-md: 0 4px 12px rgba(15,23,36,0.07), 0 2px 4px rgba(15,23,36,0.03);
    --shadow-lg: 0 12px 32px rgba(15,23,36,0.1), 0 4px 8px rgba(15,23,36,0.04);
    --border: var(--gray-200);

    /* Transitions */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

::selection { background: var(--primary-light); color: var(--primary-dark); }

/* ─── Container ────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ═══════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════ */
.navbar {
    background: var(--dark);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.navbar-super { background: #1a1145; }

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 56px;
}
.navbar-brand {
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.navbar-brand:hover { color: white; text-decoration: none; }
.navbar-brand img { border-radius: 4px; }

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}
.nav-link {
    color: var(--gray-400);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}
.nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.1);
}
.nav-username {
    color: var(--gray-400);
    font-size: 0.85rem;
    padding: 6px 8px;
}
.nav-company {
    color: var(--gray-500);
    font-size: 0.78rem;
    padding: 0 8px;
}

/* ─── Main Content ─────────────────────────────────────── */
.main-content { padding: 2rem 1.25rem; }
.bare-body { background: var(--gray-100); }

/* ═══════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════ */
h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--dark); }
h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--dark); }
h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--gray-800); }

.required { color: var(--danger); }

/* ─── Page Header ──────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.page-header h1 { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 3px rgba(37,99,235,0.25);
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-success { background: var(--success); color: white; box-shadow: 0 1px 3px rgba(22,163,74,0.25); }
.btn-success:hover { background: #15803d; color: white; }

.btn-danger { background: var(--danger); color: white; box-shadow: 0 1px 3px rgba(220,38,38,0.25); }
.btn-danger:hover { background: #b91c1c; color: white; }

.btn-warning { background: var(--warning); color: white; box-shadow: 0 1px 3px rgba(217,119,6,0.25); }
.btn-warning:hover { background: #b45309; color: white; }

.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--gray-200); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--gray-700);
}
.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-800);
}

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.78rem; border-radius: 8px; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════ */
.card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.25rem;
    transition: box-shadow 0.25s var(--ease);
}
.card-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    background: white;
}
.card-header h2 { margin: 0; font-size: 0.95rem; font-weight: 700; }
.card-header h3 { margin: 0; font-size: 0.92rem; font-weight: 600; }
.card-body { padding: 1.25rem; }
.card-footer { padding: 0.85rem 1.25rem; border-top: 1px solid var(--gray-100); background: var(--gray-50); }

/* ─── 3+1 Grid Layout ─────────────────────────────────── */
.grid-3-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 768px) {
    .grid-3-1 { grid-template-columns: 2fr 1fr; }
}

/* ─── Stat Cards ───────────────────────────────────────── */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
    transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stat-card .stat-label {
    font-size: 0.72rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.stat-card .stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--dark);
    margin-top: 0.3rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.stat-card .stat-sub {
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-top: 0.3rem;
}

/* ═══════════════════════════════════════════════════════
   GRID
   ═══════════════════════════════════════════════════════ */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--gray-700);
}
.form-control {
    display: block;
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    background: white;
    color: var(--gray-800);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-control::placeholder { color: var(--gray-400); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

textarea.form-control { min-height: 88px; resize: vertical; }
.form-hint { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.3rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }
.form-inline { display: flex; align-items: end; gap: 0.5rem; flex-wrap: wrap; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* Checkbox group */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    cursor: pointer;
    color: var(--gray-700);
}

/* ═══════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════ */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: white;
}
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead { background: var(--gray-50); }
th {
    text-align: left;
    padding: 0.7rem 1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    color: var(--gray-700);
}
tr { transition: background 0.15s; }
tr:hover { background: var(--gray-50); }
tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 100px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.badge-in, .badge-success { background: var(--success-light); color: #15803d; }
.badge-out, .badge-danger { background: var(--danger-light); color: #b91c1c; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-info { background: var(--info-light); color: #0e7490; }
.badge-super { background: #ede9fe; color: #6d28d9; font-size: 0.6rem; vertical-align: middle; }
.badge-kiosk { background: var(--primary-light); color: #1e40af; }
.badge-secure { background: #fce7f3; color: #9d174d; }
.badge-active { background: var(--success-light); color: #15803d; }
.badge-suspended { background: var(--danger-light); color: #b91c1c; }
.badge-cancelled { background: var(--gray-100); color: var(--gray-600); }

/* Break tag inline in timesheets */
.break-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 0.4rem;
    padding: 2px 7px;
    background: var(--warning-light, #fef3c7);
    color: var(--warning, #d97706);
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    cursor: help;
}
.break-summary {
    background: var(--gray-50, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 10px);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.88rem;
}
.break-summary ul {
    list-style: none;
    margin: 0.4rem 0 0;
}
.break-summary li {
    padding: 0.2rem 0;
    color: var(--gray-600, #475569);
}

/* ═══════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════ */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.5;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #ecfeff; color: #155e75; border: 1px solid #a5f3fc; }
.error-list { list-style: disc; padding-left: 1.5rem; margin-top: 0.25rem; }

/* ═══════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════ */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: var(--gray-50);
    position: relative;
}
.auth-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, var(--gray-200) 1px, transparent 1px),
        linear-gradient(var(--gray-200) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black 10%, transparent 70%);
    pointer-events: none;
}

.auth-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}
.auth-header { text-align: center; margin-bottom: 1.75rem; }
.auth-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.03em;
}
.auth-subtitle {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}
.auth-form { margin-top: 1.25rem; }
.auth-links { text-align: center; margin-top: 1.25rem; font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════ */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}
.page-link {
    padding: 0.4rem 0.8rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s;
}
.page-link:hover { background: var(--gray-50); text-decoration: none; border-color: var(--gray-300); }
.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(37,99,235,0.25);
}
.page-dots { color: var(--gray-400); padding: 0 0.3rem; }

/* ─── Detail List ──────────────────────────────────────── */
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem 1.25rem; }
.detail-list dt { font-weight: 600; color: var(--gray-500); font-size: 0.85rem; }
.detail-list dd { color: var(--gray-800); font-size: 0.9rem; }

/* ─── Profile Photo ────────────────────────────────────── */
.profile-photo-lg { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); }

/* ─── Avatar ───────────────────────────────────────────── */
.avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}
.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    border: 3px solid var(--primary-light);
}

/* ─── Error Pages ──────────────────────────────────────── */
.error-page { text-align: center; padding: 5rem 1.25rem; }
.error-page h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 5rem;
    font-weight: 800;
    color: var(--gray-200);
    letter-spacing: -0.04em;
}
.error-page p { color: var(--gray-500); margin-bottom: 2rem; font-size: 1.05rem; }

/* ═══════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Photo Thumbnails ─────────────────────────────────── */
.photo-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

/* ─── Search / Filter Bar ──────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    align-items: end;
}
.filter-bar .form-group { margin-bottom: 0; }

/* ─── Footer ───────────────────────────────────────────── */
.footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .navbar-menu { width: 100%; justify-content: center; }
    .nav-user { margin-left: 0; padding-left: 0; border: none; }
    h1 { font-size: 1.25rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
}
