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

:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --radius: 12px;
    --input-bg: #f8fafc;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--text-main);
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #1e293b, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.card {
    background: var(--card-bg);
    padding: 28px;
    margin-bottom: 24px;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

.nav {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    justify-content: center;
}

.nav button {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.nav button:hover {
    background: var(--input-bg);
    color: var(--primary);
    border-color: var(--primary);
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

input[type="text"], input[type="number"], textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

label:has(input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 20px;
    font-weight: 500;
    color: var(--text-main);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

button {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

button:active {
    transform: translateY(0);
}

/* Red button for delete */
td button {
    background: var(--danger);
    padding: 8px 14px;
    font-size: 0.85rem;
}

td button:hover {
    background: var(--danger-hover);
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

/* Table styling */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: white;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px; /* guarantees scrolling on mobile */
}

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.95rem;
    white-space: nowrap;
}

th {
    background: #f1f5f9;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

table input {
    margin-bottom: 0;
    padding: 8px 12px;
    width: 100%;
    min-width: 120px;
    background: white;
}

table input:focus {
    position: relative;
    z-index: 10;
}

.hidden {
    display: none !important;
}

/* Mobile specific tweaks */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .card {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
    
    .nav {
        flex-wrap: wrap;
    }
    
    .nav button {
        flex: 1;
        min-width: 120px;
        padding: 14px; /* Larger tap target */
    }
    
    input[type="text"], input[type="number"], textarea, button {
        font-size: 1rem; /* Prevent zoom on iOS */
    }
    
    /* Make table scroll hint obvious */
    .table-responsive {
        box-shadow: inset -10px 0 10px -10px rgba(0,0,0,0.1);
    }
}