:root {
    --apple-blue: #0071e3;
    --apple-blue-hover: #0077ed;
    --apple-gray-100: #f5f5f7;
    --apple-gray-200: #e8e8ed;
    --apple-gray-400: #86868b;
    --apple-gray-500: #6e6e73;
    --apple-gray-600: #1d1d1f;
    --apple-white: #ffffff;
    --apple-black: #000000;
    --apple-red: #ff3b30;
    --apple-green: #34c759;
    --apple-orange: #ff9500;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
    --font-stack: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html { font-size: 17px; scroll-behavior: smooth; }
body {
    font-family: var(--font-stack);
    color: var(--apple-gray-600);
    background: var(--apple-white);
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1024px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.nav-inner {
    max-width: 1024px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 52px; padding: 0 24px;
}
.nav-logo a {
    font-size: 1.15rem; font-weight: 600; color: var(--apple-gray-600);
    text-decoration: none; letter-spacing: -0.02em;
}
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a {
    color: var(--apple-gray-500); text-decoration: none;
    font-size: 0.82rem; font-weight: 400; padding: 6px 12px;
    border-radius: var(--radius-sm); transition: color 0.2s;
}
.nav-links a:hover { color: var(--apple-gray-600); background: rgba(0,0,0,0.04); }
.nav-links a.nav-cta {
    background: var(--apple-blue); color: white;
    font-weight: 500; padding: 6px 16px; border-radius: 20px;
}
.nav-links a.nav-cta:hover { background: var(--apple-blue-hover); color: white; }
.nav-user { font-size: 0.82rem; color: var(--apple-gray-500); margin-right: 8px; }

.hamburger { display: none; flex-direction: column; gap: 4px; cursor: pointer; padding: 8px; }
.hamburger span { width: 18px; height: 1.5px; background: var(--apple-gray-600); border-radius: 1px; }

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .nav-links.active {
        display: flex; flex-direction: column;
        position: absolute; top: 52px; left: 0; right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        padding: 16px 24px; gap: 4px;
        border-bottom: 1px solid rgba(0,0,0,0.08);
    }
    .nav-links.active a { width: 100%; padding: 10px 12px; }
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 12px 24px; border-radius: 28px; font-size: 0.9rem;
    font-weight: 500; text-decoration: none; cursor: pointer;
    border: none; transition: all 0.2s; font-family: var(--font-stack);
    letter-spacing: -0.01em;
}
.btn-primary { background: var(--apple-blue); color: white; }
.btn-primary:hover { background: var(--apple-blue-hover); }
.btn-secondary { background: var(--apple-gray-200); color: var(--apple-gray-600); }
.btn-secondary:hover { background: #dcdce0; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }

/* Sections */
.section { padding: 80px 0; }
.section-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--apple-blue); margin-bottom: 12px; }
.section-title { font-size: 2.8rem; font-weight: 700; letter-spacing: -0.022em; line-height: 1.1; color: var(--apple-gray-600); margin-bottom: 16px; }
.section-subtitle { font-size: 1.15rem; color: var(--apple-gray-500); font-weight: 400; max-width: 560px; line-height: 1.5; }

/* Hero */
.hero { padding: 120px 0 80px; text-align: center; }
.hero h1 { font-size: 3.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; color: var(--apple-gray-600); margin-bottom: 12px; }
.hero .gradient-text { background: linear-gradient(135deg, var(--apple-blue), #5856d6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 1.2rem; color: var(--apple-gray-500); max-width: 520px; margin: 0 auto 32px; line-height: 1.5; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.card {
    background: var(--apple-white); border-radius: var(--radius-xl);
    padding: 32px; box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 16px; }
.card-icon.blue { background: #e8f0fe; color: var(--apple-blue); }
.card-icon.green { background: #e8f8ed; color: var(--apple-green); }
.card-icon.orange { background: #fff3e6; color: var(--apple-orange); }
.card-icon.red { background: #ffe8e6; color: var(--apple-red); }
.card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 6px; color: var(--apple-gray-600); }
.card p { font-size: 0.9rem; color: var(--apple-gray-500); line-height: 1.5; }

/* Stats bar */
.stats-bar {
    display: flex; gap: 40px; justify-content: center; flex-wrap: wrap;
    padding: 40px 0; border-top: 1px solid var(--apple-gray-200);
}
.stat-item { text-align: center; }
.stat-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; color: var(--apple-gray-600); }
.stat-label { font-size: 0.8rem; color: var(--apple-gray-400); margin-top: 4px; }

/* Table */
.table-wrap { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--apple-gray-200); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table th { background: var(--apple-gray-100); text-align: left; padding: 12px 16px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--apple-gray-400); }
table td { padding: 12px 16px; border-top: 1px solid var(--apple-gray-200); }
table tr:hover td { background: rgba(0,0,0,0.015); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }
.badge-on { background: #e8f8ed; color: var(--apple-green); }
.badge-off { background: var(--apple-gray-200); color: var(--apple-gray-400); }

/* Forms */
.form-card { max-width: 400px; margin: 0 auto; background: var(--apple-white); border-radius: var(--radius-xl); padding: 40px; box-shadow: var(--shadow-md); border: 1px solid rgba(0,0,0,0.04); }
.form-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; text-align: center; color: var(--apple-gray-600); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 500; margin-bottom: 4px; color: var(--apple-gray-600); }
.form-group input {
    width: 100%; padding: 12px 16px; border: 1px solid var(--apple-gray-200);
    border-radius: var(--radius-md); font-size: 0.95rem; font-family: var(--font-stack);
    transition: border-color 0.2s; outline: none; background: var(--apple-white);
}
.form-group input:focus { border-color: var(--apple-blue); box-shadow: 0 0 0 3px rgba(0,113,227,0.1); }
.form-group small { font-size: 0.75rem; color: var(--apple-gray-400); }
.form-error { font-size: 0.82rem; color: var(--apple-red); margin-bottom: 12px; text-align: center; }
.form-error.hidden { display: none; }
.form-footer { text-align: center; margin-top: 16px; font-size: 0.85rem; color: var(--apple-gray-400); }
.form-footer a { color: var(--apple-blue); text-decoration: none; }

/* Footer */
.footer { background: var(--apple-gray-100); padding: 40px 0; color: var(--apple-gray-400); font-size: 0.78rem; }
.footer-inner { max-width: 1024px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer a { color: var(--apple-gray-500); text-decoration: none; }
.footer a:hover { color: var(--apple-gray-600); }

/* Error pages */
.error-page { text-align: center; padding: 120px 20px; }
.error-page h1 { font-size: 5rem; font-weight: 700; letter-spacing: -0.03em; color: var(--apple-gray-200); }
.error-page p { font-size: 1.1rem; color: var(--apple-gray-500); margin: 8px 0 24px; }

/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--apple-gray-200); }
.tab {
    padding: 10px 20px; font-size: 0.85rem; font-weight: 500; color: var(--apple-gray-400);
    text-decoration: none; border-bottom: 2px solid transparent; transition: all 0.2s;
}
.tab:hover { color: var(--apple-gray-600); }
.tab.active { color: var(--apple-blue); border-bottom-color: var(--apple-blue); }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.pagination a {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); font-size: 0.85rem; color: var(--apple-gray-500);
    text-decoration: none; transition: all 0.2s; background: var(--apple-gray-100);
}
.pagination a:hover { background: var(--apple-gray-200); }
.pagination a.active { background: var(--apple-blue); color: white; }

/* Search */
.search-bar { display: flex; gap: 8px; margin-bottom: 24px; max-width: 360px; }
.search-bar input {
    flex: 1; padding: 10px 16px; border: 1px solid var(--apple-gray-200);
    border-radius: var(--radius-md); font-size: 0.9rem; outline: none; font-family: var(--font-stack);
}
.search-bar input:focus { border-color: var(--apple-blue); box-shadow: 0 0 0 3px rgba(0,113,227,0.1); }

@media (max-width: 768px) {
    .section-title { font-size: 2rem; }
    .hero h1 { font-size: 2.2rem; }
    .hero { padding: 100px 0 60px; }
    .stats-bar { gap: 20px; }
    .card-grid { grid-template-columns: 1fr; }
    table { font-size: 0.8rem; }
    table th:nth-child(4), table td:nth-child(4) { display: none; }
}
