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

:root {
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-light: #dbeafe;
    --soft: #f8fafc;
    --warning: #ef4444;
    --paper: rgba(255, 255, 255, 0.85);
    --bg: #f0f4f8;
    --shadow-sm: 0 4px 6px -1px rgba(37, 99, 235, 0.08), 0 2px 4px -2px rgba(37, 99, 235, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(37, 99, 235, 0.1), 0 4px 6px -4px rgba(37, 99, 235, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(37, 99, 235, 0.15), 0 8px 10px -6px rgba(37, 99, 235, 0.05);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--ink);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    background-attachment: fixed;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

a { 
    color: var(--brand); 
    text-decoration: none; 
    font-weight: 600; 
    transition: var(--transition);
}
a:hover { color: var(--brand-dark); }

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 48%, #0f2f72 100%);
    color: #eaf2ff;
    border-right: 1px solid rgba(147, 197, 253, 0.28);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.12);
    z-index: 100;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.35) transparent;
}

.sidebar-brand {
    margin-bottom: 20px;
    padding-bottom: 18px !important;
    border-bottom: 1px solid rgba(219, 234, 254, 0.22);
}

.sidebar .sidebar-brand img {
    width: 64px !important;
    height: 64px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24) !important;
}

.sidebar .sidebar-brand div div:first-child {
    color: #ffffff !important;
    letter-spacing: 0.4px;
}

.sidebar .sidebar-brand div div:last-child {
    color: rgba(219, 234, 254, 0.82) !important;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sidebar-nav .nav-section {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    color: rgba(219, 234, 254, 0.68);
    letter-spacing: 1px;
    margin: 18px 0 8px 10px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 13px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.25;
    transition: var(--transition);
    border: 1px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(219, 234, 254, 0.2);
    transform: translateX(3px);
}

.sidebar-nav a.active {
    background: #ffffff;
    color: #1d4ed8;
    border-color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.sidebar-nav a[href*="logout"] {
    background: rgba(239, 68, 68, 0.12);
    color: #fee2e2 !important;
    border-color: rgba(254, 202, 202, 0.2);
}

.sidebar-nav a[href*="logout"]:hover {
    background: #fee2e2;
    color: #991b1b !important;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: transparent;
    border-bottom: none;
    position: relative;
    z-index: 50;
}

.public-topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    position: sticky;
    top: 0;
    padding: 0 5%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.public-menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    box-shadow: var(--shadow-sm);
}

.public-menu-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--brand-dark);
    transition: var(--transition);
}

.public-menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.public-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.public-menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.public-nav {
    display: flex; 
    align-items: center; 
    gap: 4px; 
    flex-wrap: wrap; 
}
.public-nav a { 
    color: #64748b; 
    font-weight: 600; 
    font-size: 14.5px;
    padding: 8px 16px;
    border-radius: 99px;
    transition: all 0.2s ease;
}
.public-nav a:not(.btn):hover { 
    color: var(--brand-dark); 
    background: #f1f5f9;
}
.public-nav a.btn { 
    color: white !important; 
    margin-left: 8px;
    box-shadow: 0 4px 12px rgba(37,99,235,0.2);
}
.public-nav a.btn:hover {
    box-shadow: 0 6px 16px rgba(37,99,235,0.3);
    transform: translateY(-1px);
}

.mobile-only {
    display: none;
}

.brand { 
    color: var(--brand-dark); 
    font-size: 22px; 
    font-weight: 800;
    letter-spacing: 0;
    display: flex;
    align-items: center;
}

.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto 40px; animation: fade-in-up 0.6s ease-out forwards; }

.hero {
    min-height: 480px;
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 40px;
    align-items: center;
    padding: 56px;
    background: var(--paper);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37,99,235,0.05) 0%, transparent 50%);
    z-index: -1;
    animation: rotate-bg 20s linear infinite;
}

@keyframes rotate-bg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

h1 { 
    font-size: 64px; 
    line-height: 1.05; 
    margin: 12px 0 24px; 
    font-weight: 900;
    letter-spacing: 0;
    color: var(--ink);
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 4px 20px rgba(37, 99, 235, 0.1);
}

.hero p {
    font-size: 18px;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 32px;
    font-weight: 500;
}

h2 { font-weight: 800; color: var(--ink); letter-spacing: 0; margin-top: 0; }

.eyebrow { 
    color: #1e40af; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    font-size: 13px;
    display: inline-block;
    padding: 8px 16px;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.15);
}

.tag { 
    font-size: 12px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    color: var(--brand);
    background: var(--brand-light);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 12px;
}

.actions { display: flex; gap: 16px; flex-wrap: wrap; margin: 32px 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
    color: #fff;
}

.btn.secondary { 
    background: #fff; 
    color: var(--brand);
    border: 2px solid var(--brand-light);
    box-shadow: none;
}
.btn.secondary:hover {
    background: var(--brand-light);
    border-color: var(--brand);
    transform: translateY(-3px);
}

.btn.small { padding: 8px 16px; font-size: 14px; border-radius: 8px; }

.fast-box {
    background: linear-gradient(135deg, #ffffff 0%, #fff1f2 100%);
    border: 1px solid rgba(225, 29, 72, 0.1);
    border-radius: 24px;
    padding: 36px;
    box-shadow: 0 10px 25px -5px rgba(225, 29, 72, 0.1);
    position: relative;
    transition: var(--transition);
    animation: pulse-soft 3s infinite alternate;
}

.fast-box:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 0 20px 30px -10px rgba(225, 29, 72, 0.2);
}

@keyframes pulse-soft {
    0% { box-shadow: 0 10px 25px -5px rgba(225, 29, 72, 0.1); }
    100% { box-shadow: 0 15px 35px -5px rgba(225, 29, 72, 0.25); }
}

.fast-box h2 { 
    font-size: 56px; 
    margin-bottom: 16px; 
    color: var(--warning); 
    font-weight: 800;
    text-shadow: 2px 2px 0px rgba(239, 68, 68, 0.2);
}

.fast-box p {
    font-size: 16px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.7);
    padding: 10px 16px;
    border-radius: 12px;
}

.fast-box p strong {
    color: var(--warning);
    font-size: 18px;
    min-width: 80px;
    display: inline-block;
}

.card, .form-panel, .notice, .article {
    background: var(--paper);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-light);
}

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 24px; 
    margin-top: 32px;
}

.card h3 { margin: 8px 0 12px; line-height: 1.3; font-size: 20px; }
.card p { color: var(--muted); margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.card > a {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}
.card > a::after {
    content: '→';
    margin-left: 6px;
    transition: var(--transition);
}
.card:hover > a::after { transform: translateX(6px); }

.page-head { margin-bottom: 32px; }
.page-head.row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }

.article { padding: 48px; }
.content h2, .content h3 { margin-top: 32px; }
.content ul { padding-left: 24px; color: var(--muted); }

.form-panel { max-width: 540px; margin: 0 auto; box-shadow: var(--shadow-md); }
.form-panel.wide { max-width: 900px; }

label { display: block; margin: 16px 0 8px; font-weight: 600; color: var(--ink); }
input, textarea, select {
    width: 100%;
    border: 2px solid var(--line);
    border-radius: 10px;
    padding: 12px 16px;
    font: inherit;
    background: rgba(255,255,255,0.9);
    transition: var(--transition);
    min-height: 48px;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-light);
    background: #fff;
}
textarea { resize: vertical; min-height: 100px; }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stats div {
    background: linear-gradient(135deg, #ffffff 0%, var(--brand-light) 100%);
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.stats div:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.stats strong { display: block; font-size: 42px; color: var(--brand-dark); font-weight: 800; line-height: 1; margin-bottom: 8px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

.list-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    transition: var(--transition);
}
.list-item:hover { background: var(--soft); border-radius: 8px; border-color: transparent; padding-left: 20px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--soft); font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--brand-light); }

.tabs { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.tabs a { border: 1px solid var(--line); padding: 10px 20px; border-radius: 24px; background: var(--paper); color: var(--muted); font-weight: 600; transition: var(--transition); }
.tabs a:hover { background: var(--soft); color: var(--brand); }
.tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3); }

fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 24px; padding: 24px; background: rgba(255,255,255,0.5); }
legend { font-weight: 700; color: var(--brand-dark); background: var(--brand-light); padding: 4px 12px; border-radius: 20px; font-size: 14px; }

.alert { padding: 16px 20px; border-radius: 12px; margin-bottom: 24px; display: flex; align-items: center; font-weight: 500; animation: fade-in-down 0.4s ease-out; }
.alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; box-shadow: 0 4px 12px rgba(22, 101, 52, 0.1); }
.alert.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; box-shadow: 0 4px 12px rgba(153, 27, 27, 0.1); }

.notice { margin-top: 40px; color: var(--muted); text-align: center; font-style: italic; }
.footer { text-align: center; padding: 40px 24px; color: var(--muted); margin-top: 40px; border-top: 1px solid rgba(226, 232, 240, 0.5); }

@keyframes fade-in-up {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-down {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        padding: 12px;
        border-right: none;
        border-bottom: 1px solid rgba(147, 197, 253, 0.28);
        overflow-x: auto;
        overflow-y: hidden;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
    }
    .mobile-only {
        display: flex;
    }
    .sidebar-brand {
        display: none;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        min-width: max-content;
        padding-bottom: 2px;
    }
    .sidebar-nav .nav-section {
        display: none;
    }
    .sidebar-nav a {
        min-height: 48px;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.12);
        color: rgba(255, 255, 255, 0.9);
        white-space: nowrap;
        flex: 0 0 auto;
    }
    .sidebar-nav a.active {
        background: #ffffff;
        color: #1d4ed8;
    }
    .topbar {
        min-height: 60px;
        padding: 12px 20px;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.9);
    }
    .public-topbar {
        min-height: 68px;
        padding: 10px 16px;
        background: rgba(255, 255, 255, 0.96);
        position: sticky;
    }
    .public-topbar .brand {
        min-width: 0;
    }
    .public-menu-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        margin-left: auto;
    }
    .public-nav {
        position: absolute;
        left: 12px;
        right: 12px;
        top: calc(100% + 8px);
        display: none;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: var(--shadow-lg);
        z-index: 200;
    }
    .public-nav.is-open {
        display: grid;
    }
    .public-nav a {
        min-height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 12px;
        border-radius: 10px;
        background: #f8fafc;
        text-align: center;
        font-size: 14px;
    }
    .public-nav a.btn {
        margin-left: 0;
        width: 100%;
    }
    .public-nav .lang-switch {
        grid-column: 1 / -1;
        justify-content: center;
        order: 20;
        margin: 2px 0 !important;
    }
    .public-wrapper .hero {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 24px;
        margin-top: 10px;
        padding: 32px 22px;
        text-align: left;
    }
    .public-wrapper .hero h1 {
        font-size: 46px;
        line-height: 1.08;
        margin: 10px 0 14px;
    }
    .public-wrapper .hero p {
        font-size: 16px;
        line-height: 1.65;
        margin-bottom: 0;
    }
    .public-wrapper .hero .actions {
        justify-content: flex-start;
        margin: 22px 0;
    }
    .hero-image-composition {
        max-width: 420px !important;
        margin-top: 0 !important;
    }
    .hero-image-composition img:nth-child(2),
    .hero-image-composition img:nth-child(3) {
        display: none;
    }
    .hero { grid-template-columns: 1fr; gap: 32px; padding: 40px; text-align: center; }
    .hero::before { display: none; }
    .actions { justify-content: center; }
    .eyebrow { margin: 0 auto; }
}

@media (max-width: 760px) {
    .grid, .split, .stats, .form-grid { grid-template-columns: 1fr; }
    body { font-size: 16px; line-height: 1.65; }
    .container { width: min(100% - 24px, 1120px); margin-bottom: 24px; }
    .page-head { margin-bottom: 20px; }
    .page-head.row { align-items: stretch; flex-direction: column; }
    .card, .form-panel, .notice, .article { border-radius: 12px; padding: 18px; }
    .hero { padding: 32px 20px; }
    h1 { font-size: 36px; }
    h2 { font-size: 24px; line-height: 1.25; }
    .fast-box h2 { font-size: 48px; }
    .btn { width: 100%; min-height: 52px; padding: 14px 18px; border-radius: 10px; font-size: 16px; }
    .btn.small { min-height: 46px; }
    label { font-size: 16px; line-height: 1.45; }
    input, textarea, select { min-height: 52px; padding: 14px 16px; font-size: 16px; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 480px) {
    .container { width: min(100% - 16px, 1120px); }
    .topbar { padding: 10px 12px; }
    .public-topbar { min-height: 64px; padding: 8px 10px; }
    .public-topbar .brand img { width: 40px !important; height: 40px !important; }
    .public-topbar .brand div div:first-child { font-size: 15px !important; }
    .public-topbar .brand div div:last-child { font-size: 10px !important; }
    .public-menu-toggle { width: 44px; height: 44px; }
    .public-nav {
        left: 8px;
        right: 8px;
        grid-template-columns: 1fr;
        max-height: calc(100vh - 84px);
        overflow-y: auto;
    }
    .public-wrapper .hero {
        padding: 22px 16px;
        border-radius: 16px;
        text-align: left;
    }
    .public-wrapper .hero h1 {
        font-size: 38px;
    }
    .public-wrapper .hero .actions {
        flex-direction: column;
        gap: 10px;
    }
    .home-focus-list {
        gap: 8px !important;
    }
    .home-focus-list span {
        width: 100%;
        text-align: center;
    }
    .sidebar { padding: 10px 8px; }
    .sidebar-nav a { min-height: 46px; padding: 9px 12px; font-size: 13px; }
    .hero { padding: 24px 16px; border-radius: 16px; }
    h1 { font-size: 32px; line-height: 1.12; }
    .stats div { padding: 18px; }
}
