/* Tap Go SaaS Theme - Modernized */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors */
    --primary: #D32F2F;
    --primary-hover: #B71C1C;
    --primary-light: #FFEBEE;

    /* Neutral Colors */
    --bg-body: #F3F4F6;
    --bg-surface: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border: #E5E7EB;

    /* UI Variables */
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #111827;
    /* Darker, more modern slate */
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
}

body.collapsed .sidebar {
    transform: translateX(-260px);
}

body.collapsed .main {
    margin-left: 0;
}

.brand {
    padding: 24px;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary);
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nav {
    list-style: none;
    padding: 16px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #9CA3AF;
    text-decoration: none;
    transition: all 0.2s;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav li a.active {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

/* Main Content */
.main {
    margin-left: 260px;
    padding: 32px;
    width: 100%;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 1600px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    letter-spacing: -0.025em;
}

/* Cards & Containers */
.card {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #FFF5F5 0%, #FEE2E2 100%);
    border-left: 4px solid var(--primary);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #7F1D1D;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-box i {
    color: var(--primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f9fafb 100%);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-num {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Typography Utilities */
.text-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--text-muted);
}

.font-medium {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #1F2937;
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    background-color: #000;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.25);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: #F9FAFB;
    border-color: #D1D5DB;
}

.btn-danger {
    background-color: #EF4444;
    color: white;
}

.btn-danger:hover {
    background-color: #DC2626;
}

/* Forms */
input[type=text],
input[type=password],
input[type=number],
input[type=search],
input[type=email],
input[type=tel],
input[type=date],
input[type=time],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    background-color: #F9FAFB;
}

/* Time input specific styling */
input[type=time] {
    cursor: pointer;
}

input[type=time]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: opacity(0.6);
    transition: filter 0.2s;
}

input[type=time]::-webkit-calendar-picker-indicator:hover {
    filter: opacity(1);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #374151;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 8px;
}

th {
    background-color: #F9FAFB;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    background-color: #fff;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #F9FAFB;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-active {
    background: #ECFDF5;
    color: #059669;
}

.badge-inactive {
    background: #FEF2F2;
    color: #DC2626;
}

.badge-in {
    background: #EFF6FF;
    color: #2563EB;
}

.badge-out {
    background: #FDF2F8;
    color: #DB2777;
}

/* Utilities */
.flex {
    display: flex;
}

/* Form Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

.w-full {
    width: 100%;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Login Page Only */
body.login-page {
    background-color: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #fff;
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    border-top: 4px solid var(--primary);
}

/* Sidebar Toggle Button */
#toggleSidebar {
    position: fixed;
    top: 15px;
    left: 20px;
    z-index: 1100;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

#toggleSidebar:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.collapsed #toggleSidebar {
    color: var(--text-main);
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

body.collapsed #toggleSidebar:hover {
    background-color: #F9FAFB;
    color: var(--primary);
}