/* =================================================================
   SEGUNOR DADOS PORTAL — Main Stylesheet
   Aligned with segunor-website design system
   Colors: #fdc500 (accent/yellow) + black
   ================================================================= */

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

:root {
    --accent: #fdc500;
    --accent-hover: #e6b400;
    --accent-light: rgba(253, 197, 0, 0.1);
    --accent-border: rgba(253, 197, 0, 0.2);
    --transition: 0.3s ease;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Backward-compatible aliases (used in inline styles across views) */
    --gold: #fdc500;
    --gold-dark: #d4a800;
    --gold-light: #ffe066;
    --black: #0a0a0a;
    --dark-bg: #111111;
    --dark-surface: #1a1a1a;
    --dark-border: #2a2a2a;
    --dark-text: #e5e5e5;
    --dark-muted: #888888;
}

/* Dark Mode (default) */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --bg-card: #0d0d0d;
    --bg-card-hover: #151515;
    --bg-input: #111111;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --border-color: #1a1a1a;
    --border-light: #222222;
    --nav-bg: rgba(0, 0, 0, 0.85);
    --footer-bg: #050505;

    /* Backward-compatible short aliases */
    --bg: #111111;
    --surface: #1a1a1a;
    --border: #2a2a2a;
    --text: #e5e5e5;
    --muted: #888888;
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f8f8;
    --bg-tertiary: #f0f0f0;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f5f5;
    --bg-input: #f5f5f5;
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-muted: #999999;
    --border-color: #e5e5e5;
    --border-light: #eeeeee;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --footer-bg: #fafafa;

    /* Backward-compatible short aliases */
    --bg: #f5f5f5;
    --surface: #ffffff;
    --border: #e0e0e0;
    --text: #1a1a1a;
    --muted: #666666;
}

html {
    scroll-behavior: smooth;
}

/* Logo visibility based on theme */
[data-theme="dark"] .dark-mode-logo {
    display: block;
}

[data-theme="dark"] .light-mode-logo {
    display: none;
}

[data-theme="light"] .dark-mode-logo {
    display: none;
}

[data-theme="light"] .light-mode-logo {
    display: block;
}

.dark-mode-logo,
.light-mode-logo {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* Nav icon sizing */
.nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.active .nav-icon,
a:hover .nav-icon {
    opacity: 1;
}

/* Choice card icon */
.choice-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.75rem;
    color: var(--accent);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition), color var(--transition);
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    color: var(--text-secondary);
}

/* ================================================================
   UTILITY CLASSES (Tailwind-like, from website)
   ================================================================ */

/* Text */
.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-accent {
    color: var(--accent) !important;
}

/* Background */
.bg-primary {
    background-color: var(--bg-primary);
}

.bg-secondary {
    background-color: var(--bg-secondary);
}

.bg-tertiary {
    background-color: var(--bg-tertiary);
}

.bg-card {
    background-color: var(--bg-card);
}

.bg-accent {
    background-color: var(--accent);
}

/* Border */
.border-theme {
    border-color: var(--border-color);
}

.border-light {
    border-color: var(--border-light);
}

/* Transition */
.transition-colors {
    transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}

.transition-all {
    transition: all var(--transition);
}

/* Font */
.font-sans {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.max-w-7xl {
    max-width: 80rem;
}

.max-w-5xl {
    max-width: 64rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.max-w-3xl {
    max-width: 48rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-w-xl {
    max-width: 36rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* Padding */
.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.py-16 {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.py-20 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.py-24 {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.pt-16 {
    padding-top: 4rem;
}

.pt-20 {
    padding-top: 5rem;
}

.pb-8 {
    padding-bottom: 2rem;
}

.pb-12 {
    padding-bottom: 3rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

/* Margin */
.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mt-10 {
    margin-top: 2.5rem;
}

.mt-12 {
    margin-top: 3rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-10 {
    margin-bottom: 2.5rem;
}

.mb-12 {
    margin-bottom: 3rem;
}

/* Flexbox */
.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.hidden {
    display: none !important;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

/* Gap */
.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.gap-10 {
    gap: 2.5rem;
}

/* Width / Height */
.w-4 {
    width: 1rem;
}

.w-5 {
    width: 1.25rem;
}

.w-6 {
    width: 1.5rem;
}

.w-8 {
    width: 2rem;
}

.w-10 {
    width: 2.5rem;
}

.w-12 {
    width: 3rem;
}

.w-full {
    width: 100%;
}

.h-4 {
    height: 1rem;
}

.h-5 {
    height: 1.25rem;
}

.h-6 {
    height: 1.5rem;
}

.h-8 {
    height: 2rem;
}

.h-10 {
    height: 2.5rem;
}

.h-12 {
    height: 3rem;
}

.h-16 {
    height: 4rem;
}

.h-20 {
    height: 5rem;
}

.min-h-screen {
    min-height: 100vh;
}

/* Typography Sizes */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.text-5xl {
    font-size: 3rem;
    line-height: 1.1;
}

/* Font Weights */
.font-light {
    font-weight: 300;
}

.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-extrabold {
    font-weight: 800;
}

/* Text Alignment */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Text Decoration */
.uppercase {
    text-transform: uppercase;
}

.tracking-tight {
    letter-spacing: -0.025em;
}

.tracking-wide {
    letter-spacing: 0.05em;
}

.leading-relaxed {
    line-height: 1.75;
}

.leading-tight {
    line-height: 1.25;
}

/* Rounded */
.rounded {
    border-radius: 0.375rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.rounded-full {
    border-radius: 9999px;
}

/* Border */
.border {
    border: 1px solid var(--border-color);
}

.border-t {
    border-top: 1px solid var(--border-color);
}

.border-b {
    border-bottom: 1px solid var(--border-color);
}

.border-l {
    border-left: 1px solid var(--border-color);
}

/* Overflow / Position */
.overflow-hidden {
    overflow: hidden;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

.top-0 {
    top: 0;
}

.left-0 {
    left: 0;
}

.right-0 {
    right: 0;
}

.bottom-0 {
    bottom: 0;
}

.inset-0 {
    inset: 0;
}

.z-10 {
    z-index: 10;
}

.z-20 {
    z-index: 20;
}

.z-50 {
    z-index: 50;
}

/* Opacity */
.opacity-0 {
    opacity: 0;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-75 {
    opacity: 0.75;
}

/* Cursor / Selection */
.cursor-pointer {
    cursor: pointer;
}

.select-none {
    user-select: none;
}

.pointer-events-none {
    pointer-events: none;
}

.underline {
    text-decoration: underline;
}

.no-underline {
    text-decoration: none;
}

/* Spacing */
.space-y-1>*+* {
    margin-top: 0.25rem;
}

.space-y-2>*+* {
    margin-top: 0.5rem;
}

.space-y-3>*+* {
    margin-top: 0.75rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

.space-y-6>*+* {
    margin-top: 1.5rem;
}

.space-y-8>*+* {
    margin-top: 2rem;
}

/* Grid */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.backdrop-blur-md {
    backdrop-filter: blur(12px);
}

/* ================================================================
   COMPONENTS
   ================================================================ */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
    gap: 0.5rem;
    line-height: 1.25;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--accent);
    color: #000000;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background: var(--accent);
    color: #000000;
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: var(--success);
    color: #fff;
}

.btn-success:hover {
    background-color: #16a34a;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all var(--transition);
    margin-bottom: 1.25rem;
}

.card:hover {
    border-color: var(--accent-border);
    background-color: var(--bg-card-hover);
}

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

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0;
}

.card-accent {
    border-left: 3px solid var(--accent);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
    font-family: inherit;
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(253, 197, 0, 0.15);
}

select.form-control {
    appearance: auto;
}

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

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-check input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.15rem;
    accent-color: var(--accent);
}

.form-inline {
    display: flex;
    gap: 0.5rem;
    align-items: end;
    flex-wrap: wrap;
}

.form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--info);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-primary {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

.badge-success {
    background: rgba(34, 197, 94, .1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, .2);
}

.badge-danger {
    background: rgba(239, 68, 68, .1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, .2);
}

.badge-info {
    background: rgba(59, 130, 246, .1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, .2);
}

.badge-warning {
    background: rgba(245, 158, 11, .1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, .2);
}

.badge-secondary {
    background: rgba(136, 136, 136, .1);
    color: var(--text-muted);
    border: 1px solid rgba(136, 136, 136, .2);
}

.badge-dark {
    background: rgba(10, 10, 10, 0.5);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-flag {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
    font-size: 0.7rem;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-card-hover);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.3rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
    text-decoration: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination .active span {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: 600;
}

.pagination .disabled span {
    opacity: 0.4;
}

/* ================================================================
   ADMIN LAYOUT (Sidebar + Topbar)
   ================================================================ */

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 2px solid var(--accent);
}

.sidebar-logo {
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.05em;
}

.sidebar-logo span {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.sidebar-nav a.active {
    background: rgba(253, 197, 0, 0.12);
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

.sidebar-nav .nav-section {
    padding: 0.5rem 1.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
}

/* Topbar */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar .user-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.topbar .user-info strong {
    color: var(--text-primary);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Content Area */
.content-area {
    padding: 1.5rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-header .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ================================================================
   DADOS-PORTAL SPECIFIC COMPONENTS
   ================================================================ */

/* Headings with accent color */
h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent);
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--accent-border);
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.detail-item .detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.detail-item .detail-value {
    font-size: 0.95rem;
    margin-top: 0.15rem;
}

.detail-item.full {
    grid-column: 1 / -1;
}

/* Diff Styles (for submission comparisons) */
.diff-old {
    color: var(--danger);
    text-decoration: line-through;
}

.diff-new {
    color: var(--success);
    font-weight: 600;
}

.diff-arrow {
    color: var(--text-muted);
    margin: 0 0.3rem;
}

.diff-unchanged {
    color: var(--text-muted);
}

/* Nav Arrows */
.nav-arrows {
    display: flex;
    gap: 0.5rem;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.3rem 0.6rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all var(--transition);
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ================================================================
   PUBLIC LAYOUT COMPONENTS
   ================================================================ */

/* Public Header */
/* Bare element styles (used by public layout) */
header {
    background: var(--bg-secondary);
    border-bottom: 3px solid var(--accent);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

main {
    flex: 1;
    padding: 2rem 0;
}

footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.public-header {
    background: var(--bg-secondary);
    border-bottom: 3px solid var(--accent);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.05em;
}

.logo span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
    display: block;
}

/* Public Footer */
.public-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.public-footer a {
    color: var(--accent);
    text-decoration: none;
}

.public-footer a:hover {
    text-decoration: underline;
}

/* Choice Cards (public home page) */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.choice-card {
    display: block;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    text-align: center;
}

.choice-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    background-color: var(--bg-card-hover);
}

.choice-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.choice-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Section Divider */
.section-divider {
    border-top: 2px solid var(--accent);
    margin: 2rem 0 1.5rem;
    padding-top: 1.5rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.upload-area:hover {
    border-color: var(--accent);
}

.upload-area input {
    display: none;
}

.upload-area .upload-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.upload-area .upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (min-width: 640px) {
    .choice-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sm\:px-6 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .sm\:flex-row {
        flex-direction: row;
    }

    .sm\:items-center {
        align-items: center;
    }

    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:flex-row {
        flex-direction: row;
    }

    .md\:text-left {
        text-align: left;
    }
}

@media (min-width: 1024px) {
    .lg\:hidden {
        display: none;
    }

    .lg\:flex {
        display: flex;
    }

    .lg\:block {
        display: block;
    }

    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .lg\:col-span-1 {
        grid-column: span 1;
    }

    .lg\:col-span-2 {
        grid-column: span 2;
    }

    .lg\:px-8 {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .lg\:h-20 {
        height: 5rem;
    }

    .lg\:pt-20 {
        padding-top: 5rem;
    }
}

/* Admin mobile responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger {
        display: block;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================================
   ACCESSIBILITY & ANIMATIONS
   ================================================================ */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

/* Print */
@media print {

    .no-print,
    nav,
    footer,
    .sidebar,
    .topbar {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .main-content {
        margin-left: 0;
    }
}