/* ============================================================
   TRATO - Strategic Growth OS
   Main Stylesheet v2.0
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ── CSS Variables ── */
:root {
    /* Brand Colors */
    --navy: #0F1629;
    --navy-light: #1A2340;
    --navy-mid: #232D47;
    --navy-surface: #283352;
    --blue: #3B82F6;
    --blue-hover: #2563EB;
    --blue-glow: rgba(59, 130, 246, 0.15);
    --orange: #F59E0B;
    --orange-hover: #D97706;
    --orange-glow: rgba(245, 158, 11, 0.15);
    --red: #EF4444;
    --green: #10B981;
    --purple: #8B5CF6;
    --cyan: #06B6D4;
    
    /* Neutrals */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 0px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    
    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-glow-blue: 0 0 20px rgba(59,130,246,0.25);
    --shadow-glow-orange: 0 0 20px rgba(245,158,11,0.25);
    
    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.25s;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

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

a { color: var(--blue); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--blue-hover); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 600; line-height: 1.3; }

/* ── App Layout ── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    transition: margin-left var(--duration) var(--ease);
    min-height: 100vh;
}

@media (max-width: 768px) {
    .main-content { margin-left: 0; padding: 20px 16px; }
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--navy-light);
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--duration) var(--ease);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--navy-surface); border-radius: 4px; }

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: var(--shadow-glow-blue);
}

.sidebar-logo span {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--white);
    letter-spacing: 1px;
}

.sidebar-brand h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 2px;
}

.sidebar-brand small {
    font-size: 10px;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
    margin-top: 2px;
}

/* Sidebar Progress */
.sidebar-progress {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--navy);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--orange));
    border-radius: 3px;
    transition: width 0.6s var(--ease);
}

/* Sidebar Navigation */
.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section-label {
    padding: 16px 20px 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    margin: 2px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--duration) var(--ease);
    cursor: pointer;
    position: relative;
}

.nav-item:hover:not(.locked) {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--blue-glow);
    color: var(--blue);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--blue);
    border-radius: 0 3px 3px 0;
}

.nav-item.completed .nav-icon {
    color: var(--green);
}

.nav-item.locked {
    opacity: 0.35;
    cursor: not-allowed;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item .lock-icon {
    margin-left: auto;
    opacity: 0.5;
    font-size: 12px;
}

.nav-item.completed .check-icon {
    margin-left: auto;
    color: var(--green);
    font-size: 14px;
}

/* Sidebar User */
.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--orange), var(--red));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--white);
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .user-role { font-size: 11px; color: var(--orange); text-transform: uppercase; letter-spacing: 1px; }

.sidebar-logout {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: background var(--duration) var(--ease);
}

.sidebar-logout:hover { background: rgba(239,68,68,0.1); }

/* ── Cards ── */
.card {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--duration) var(--ease);
}

.card:hover { border-color: rgba(255,255,255,0.1); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
}

.btn-primary {
    background: var(--blue);
    color: var(--white);
    box-shadow: var(--shadow-glow-blue);
}
.btn-primary:hover { background: var(--blue-hover); transform: translateY(-1px); }

.btn-orange {
    background: var(--orange);
    color: var(--navy);
    box-shadow: var(--shadow-glow-orange);
}
.btn-orange:hover { background: var(--orange-hover); transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-block { width: 100%; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--navy);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    transition: all var(--duration) var(--ease);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-glow);
}

.form-input::placeholder { color: var(--text-muted); }

.form-textarea { resize: vertical; min-height: 100px; }

.form-icon-input {
    position: relative;
}
.form-icon-input .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.form-icon-input .form-input { padding-left: 44px; }

.form-help { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 6px; }

/* ── Alerts ── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.alert-info { background: var(--blue-glow); color: var(--blue); border: 1px solid rgba(59,130,246,0.2); }
.alert-success { background: rgba(16,185,129,0.1); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.alert-warning { background: var(--orange-glow); color: var(--orange); border: 1px solid rgba(245,158,11,0.2); }
.alert-error { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }

/* ── Page Headers ── */
.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-header h1 span { color: var(--orange); }

.page-header p {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 600px;
}

/* ── Locked State ── */
.locked-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.locked-icon {
    width: 64px;
    height: 64px;
    background: rgba(239,68,68,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.locked-icon svg { width: 28px; height: 28px; color: var(--red); }

.locked-overlay h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.locked-overlay p {
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: 24px;
}

/* ── Dashboard Grid ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue { background: var(--blue-glow); color: var(--blue); }
.stat-icon.orange { background: var(--orange-glow); color: var(--orange); }
.stat-icon.green { background: rgba(16,185,129,0.15); color: var(--green); }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: var(--purple); }

.stat-info .stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.stat-info .stat-label { font-size: 13px; color: var(--text-muted); }

/* ── Steps Timeline ── */
.steps-timeline {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
}

.step-item.completed { opacity: 0.7; }
.step-item.current { background: var(--blue-glow); }
.step-item.locked { opacity: 0.35; }

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-item.completed .step-number { background: var(--green); color: var(--white); }
.step-item.current .step-number { background: var(--blue); color: var(--white); }
.step-item.locked .step-number { background: var(--navy-surface); color: var(--text-muted); }

.step-info .step-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.step-item.locked .step-info .step-name { color: var(--text-muted); }
.step-info .step-section { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ── Hito Card ── */
.hito-card {
    background: var(--navy-mid);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
}

.hito-card h4 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.hito-card p { font-size: 13px; color: var(--text-secondary); }

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--navy);
}

.login-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--blue-glow) 0%, transparent 70%);
    pointer-events: none;
}

.login-right {
    flex: 1;
    background: var(--navy-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

.login-right::before {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, var(--orange-glow) 0%, transparent 70%);
    pointer-events: none;
}

.login-hero {
    text-align: center;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-hero h1 {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 4px;
    margin-bottom: 4px;
}

.login-hero .tagline {
    color: var(--orange);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 32px;
}

.login-hero .description {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.7;
}

.login-hero .description em {
    color: var(--orange);
    font-style: italic;
}

.login-box {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-box h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.login-footer a { color: var(--orange); font-weight: 600; }

@media (max-width: 900px) {
    .login-left { display: none; }
    .login-right { flex: 1; }
}

/* ── Mobile Sidebar Toggle ── */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-toggle { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 99;
    }
    .sidebar-overlay.show { display: block; }
}

/* ── Utilities ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-orange { color: var(--orange); }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-in { animation: fadeIn 0.4s var(--ease) both; }
.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }
