:root {
    --bg: #f7fafc;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #64748b;
    --border: #e5e7eb;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-soft: #ccfbf1;
    --blue: #2563eb;
    --orange: #ea580c;
    --red: #dc2626;
    --green: #16a34a;
    --purple: #7c3aed;
    --shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
    background: rgba(255,255,255,0.96);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 12px;
    background: var(--primary); color: white; font-weight: 900;
}
.nav { display: flex; align-items: center; gap: 16px; }
.nav a { color: var(--text); font-weight: 600; }
.nav a.active { color: var(--primary); }
.nav-toggle { display: none; }
.main { padding: 30px 0 54px; min-height: 72vh; }
.footer { border-top: 1px solid var(--border); background: #fff; color: var(--muted); }
.footer-inner { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 24px;
    align-items: stretch;
    margin: 18px 0 28px;
}
.hero-card, .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}
.hero-card { padding: 34px; }
.hero h1 { font-size: clamp(30px, 5vw, 56px); line-height: 1.05; margin: 0 0 18px; }
.hero p { color: var(--muted); font-size: 17px; margin-bottom: 24px; }
.hero-media { padding: 16px; }
.video-frame { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 16px; background: #e2e8f0; }
.running { overflow: hidden; background: var(--primary-soft); color: var(--primary-dark); border: 1px solid #99f6e4; border-radius: 999px; padding: 10px 0; margin: 16px 0 24px; }
.running span { display: inline-block; white-space: nowrap; padding-left: 100%; animation: running 24s linear infinite; font-weight: 700; }
@keyframes running { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { padding: 22px; margin-bottom: 18px; }
.card h2, .card h3 { margin-top: 0; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.stat .num { font-size: 30px; font-weight: 900; color: var(--primary); display: block; }
.stat .label { color: var(--muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 14px;
    min-height: 42px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    background: #fff;
    color: var(--text);
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 7px 11px; min-height: 34px; font-size: 13px; }
.btn-primary { background: var(--primary); color: #fff !important; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: var(--border); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-muted { background: #e2e8f0; color: var(--text); }
.form-group { margin-bottom: 14px; }
label { display: block; margin-bottom: 6px; font-weight: 700; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    padding: 11px 12px;
    font: inherit;
}
textarea { min-height: 130px; resize: vertical; }
.help { font-size: 13px; color: var(--muted); margin-top: 4px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f8fafc; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 800; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.alert { padding: 12px 14px; border-radius: 14px; margin: 0 0 16px; border: 1px solid var(--border); }
.alert-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.meta { color: var(--muted); font-size: 14px; }
.timeline { display: grid; gap: 14px; }
.timeline-item { border-left: 4px solid var(--primary); background: #fff; border-radius: 14px; padding: 14px 16px; border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.timeline-item.internal { border-left-color: var(--orange); }
.ticket-box { border: 2px dashed var(--primary); padding: 24px; border-radius: 18px; background: #fff; }
.ticket-number { font-size: clamp(24px, 4vw, 42px); color: var(--primary); font-weight: 900; letter-spacing: 1px; }
.filter-form { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 12px; align-items: end; }
.login-card { max-width: 430px; margin: 30px auto; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.small { font-size: 13px; }
.print-only { display: none; }
@media (max-width: 900px) {
    .hero, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .filter-form { grid-template-columns: 1fr 1fr; }
    .nav-toggle { display: inline-flex; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 8px 10px; }
    .nav { display: none; position: absolute; top: 68px; left: 16px; right: 16px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 14px; flex-direction: column; align-items: stretch; box-shadow: var(--shadow); }
    .nav.open { display: flex; }
}
@media print {
    .topbar, .footer, .no-print, .btn-row, .alert { display: none !important; }
    body { background: #fff; }
    .main { padding: 0; }
    .container { width: 100%; }
    .card, .ticket-box, .table-wrap { box-shadow: none; border-color: #999; }
    .print-only { display: block; }
}
