:root {
    --apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --bg-color: #f5f5f7;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --border-color: rgba(0, 0, 0, 0.1);
    --blue-primary: #0071e3;
    --blue-hover: #0077ED;
    --focus-ring: rgba(0, 113, 227, 0.3);
    --error-color: #ff3b30;
}

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

body {
    font-family: var(--apple-font);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Container & Visibility */
.container {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.container.active {
    display: flex;
    opacity: 1;
}

/* Login Screen */
#login-container {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    text-align: center;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: var(--apple-font);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
    outline: none;
}

input:focus {
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

input::placeholder {
    color: #9ca3af;
}

.primary-button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 500;
    font-family: var(--apple-font);
    color: white;
    background-color: var(--blue-primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 8px;
}

.primary-button:hover {
    background-color: var(--blue-hover);
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    min-height: 20px;
    margin-bottom: 16px;
    text-align: left;
}

/* Main App Screen */
#app-container {
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

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

.search-box input {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 8px;
    width: 250px;
}

.secondary-button {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--apple-font);
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 32px 24px;
}

.table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #fbfbfc;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}

td {
    font-size: 15px;
    color: var(--text-primary);
}

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

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f9f9fa;
}

.region-cell {
    font-weight: 500;
}

.code-cell {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.check-mark {
    color: var(--blue-primary);
    font-weight: 600;
}

.dash-mark {
    color: #d1d5db;
}

.empty-state {
    text-align: center;
    padding: 64px 20px;
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    th, td {
        padding: 12px;
        white-space: nowrap;
    }
}
