/* ONX Reach - Modern PWA UI/UX */

:root {
    --primary: #0F172A; /* Slate 900 */
    --primary-light: #334155;
    --secondary: #3B82F6; /* Blue 500 */
    --secondary-hover: #2563EB;
    
    --success: #10B981; /* Emerald 500 */
    --warning: #F59E0B; /* Amber 500 */
    --danger: #EF4444; /* Red 500 */
    --info: #0EA5E9; /* Sky 500 */
    
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-light: #F8FAFC;
    
    --bg-main: #F1F5F9;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    
    --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
}

body {
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; /* NO HORIZONTAL SCROLL */
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--secondary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 600;
    line-height: 1.2;
}

/* Header */
.site-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo a {
    text-decoration: none;
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hamburger & Mobile Nav */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    padding: 12px;
    min-height: 44px;
    min-width: 44px;
}

.main-nav {
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--primary);
    text-decoration: none;
}

/* Main Content */
.main-content {
    padding: 24px 16px;
    flex: 1;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: block;
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.action-card h3 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: var(--primary);
}
.action-card p {
    color: var(--text-muted);
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    padding: 10px 16px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    text-decoration: none !important;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px; /* Touch target */
    line-height: 1.2;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-light);
}

.btn-secondary {
    color: #fff;
    background-color: var(--secondary);
}
.btn-secondary:hover:not(:disabled) {
    background-color: var(--secondary-hover);
}

.btn-success {
    color: #fff;
    background-color: var(--success);
}
.btn-danger {
    color: #fff;
    background-color: var(--danger);
}
.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-main);
}
.btn-outline:hover {
    background: var(--bg-main);
}
.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-height: 36px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--primary);
    font-size: 0.9rem;
}
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: #F8FAFC;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: var(--surface);
}

/* Alerts */
.alert {
    padding: 16px;
    margin-bottom: 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}
.alert-success { background-color: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background-color: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background-color: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background-color: #F0F9FF; color: #075985; border: 1px solid #BAE6FD; }

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Force minimum width to prevent squishing */
}
.admin-table th, .admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.95rem;
}
.admin-table th {
    background-color: #F8FAFC;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
}
.badge-success { background: #ECFDF5; color: #059669; }
.badge-warning { background: #FFFBEB; color: #D97706; }
.badge-danger { background: #FEF2F2; color: #DC2626; }
.badge-info { background: #F0F9FF; color: #0284C7; }
.badge-neutral { background: #F1F5F9; color: #475569; }

/* Media Elements */
img, video {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* Footer */
.site-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    .main-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--surface);
        padding: 16px;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    }
    .main-nav.show {
        display: flex;
    }
    .main-nav a {
        padding: 12px;
        border-radius: var(--radius-sm);
    }
    .main-nav a:hover {
        background: var(--bg-main);
    }
    .card {
        padding: 16px;
    }
}

/* Password visibility toggle */
.password-field-wrap {
    position: relative;
    display: block;
}
.password-field-wrap input[type="password"],
.password-field-wrap input[type="text"] {
    padding-right: 42px !important;
    box-sizing: border-box;
}
.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    padding: 4px 6px;
    color: #6c757d;
    user-select: none;
}
.password-toggle-btn:hover {
    color: #0f172a;
}
