/* TINZRYPOS - Base Styles (Phase 1) */

:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --accent: #0EA5E9;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --text: #0F172A;
    --text-muted: #64748B;
    --success: #16A34A;
    --error: #DC2626;
    --warning: #D97706;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --sidebar-width: 240px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

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

/* Auth */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 100%);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    padding: 32px;
}

.auth-card h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-card .subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 13px;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color .15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover { background: var(--bg); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-success { background: #DCFCE7; color: #166534; }
.alert-error { background: #FEE2E2; color: #991B1B; }

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

.sidebar {
    width: var(--sidebar-width);
    background: #0F172A;
    color: #E2E8F0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 20px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-item {
    display: block;
    padding: 10px 20px;
    color: #94A3B8;
    font-size: 13px;
    transition: background .15s, color .15s;
}

.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(37,99,235,.2); color: #fff; border-left: 3px solid var(--primary); }
.nav-item.disabled { opacity: .45; pointer-events: none; }

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 12px 16px;
}

.sidebar-footer {
    padding: 12px 20px;
    font-size: 11px;
    color: #64748B;
    border-top: 1px solid rgba(255,255,255,.08);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-info { font-size: 13px; color: var(--text-muted); }

.content-area {
    padding: 24px;
    flex: 1;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

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

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.stat-card .label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card .value { font-size: 22px; font-weight: 700; }

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

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-muted);
    display: none;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .btn-icon.sidebar-toggle { display: inline-flex; }
}
