/* =====================================================================
   IEEE Kazakhstan Section - Event Sponsorship Portal
   Stylesheet (blue & white, professional, no icons)
   ===================================================================== */

:root {
    --ieee-blue: #00629B;       /* IEEE primary blue (matches logo) */
    --ieee-blue-dark: #004B7A;
    --ieee-blue-light: #E5F0F7;
    --ieee-blue-soft: #F4F9FC;
    --border: #D6DEE5;
    --border-light: #EAEEF2;
    --text: #1A2A3A;
    --text-soft: #4A5A6B;
    --text-muted: #7B8794;
    --white: #FFFFFF;
    --bg: #F7F9FB;
    --green: #2E7D32;
    --green-bg: #E8F5E9;
    --amber: #B26A00;
    --amber-bg: #FFF4E0;
    --red: #B3261E;
    --red-bg: #FCE8E6;
    --shadow-sm: 0 1px 2px rgba(0, 30, 60, 0.05);
    --shadow:    0 2px 8px rgba(0, 30, 60, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 30, 60, 0.10);
    --radius: 4px;
    --radius-lg: 6px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
}

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

h1, h2, h3, h4, h5 {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    color: var(--ieee-blue-dark);
    margin: 0 0 12px;
    font-weight: 600;
}
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }

p { margin: 0 0 12px; }

hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 24px 0;
}

/* ---------- Top bar ---------- */
.topbar {
    background: var(--white);
    border-bottom: 3px solid var(--ieee-blue);
    box-shadow: var(--shadow-sm);
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none !important;
}

.brand img {
    height: 48px;
    width: auto;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-title {
    color: var(--ieee-blue-dark);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.2px;
}

.brand-tagline {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.topnav a {
    color: var(--text-soft);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.topnav a:hover {
    background: var(--ieee-blue-light);
    color: var(--ieee-blue-dark);
    text-decoration: none;
}

.topnav a.active {
    background: var(--ieee-blue);
    color: var(--white);
}

.user-pill {
    background: var(--ieee-blue-soft);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-soft);
}

.user-pill strong { color: var(--ieee-blue-dark); }

/* ---------- Layout ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.container-narrow {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--ieee-blue);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header h1 { margin: 0 0 4px; }
.page-header p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ---------- Cards ---------- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: var(--ieee-blue-soft);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    font-weight: 600;
    color: var(--ieee-blue-dark);
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.card-body { padding: 20px; }

.card-section {
    border-top: 1px solid var(--border-light);
    padding: 18px 20px;
}
.card-section:first-child { border-top: none; }
.card-section h3 {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ieee-blue);
    display: inline-block;
}

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

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

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 720px) {
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
}

label .req { color: var(--red); margin-left: 2px; }

.form-help {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=url], input[type=tel],
select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    transition: border 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--ieee-blue);
    box-shadow: 0 0 0 3px rgba(0, 98, 155, 0.15);
}

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

.checkbox-row, .radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
}

.checkbox-row label, .radio-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    color: var(--text);
    font-size: 14px;
    margin: 0;
    cursor: pointer;
}

input[type=checkbox], input[type=radio] {
    margin: 0;
    accent-color: var(--ieee-blue);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: var(--ieee-blue);
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.15s, border 0.15s;
    line-height: 1.4;
}

.btn:hover { background: var(--ieee-blue-dark); }

.btn-secondary {
    background: var(--white);
    color: var(--ieee-blue);
    border-color: var(--ieee-blue);
}
.btn-secondary:hover { background: var(--ieee-blue-light); }

.btn-success { background: var(--green); }
.btn-success:hover { background: #1F5C23; }

.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8E1A14; }

.btn-amber { background: var(--amber); }
.btn-amber:hover { background: #8A5100; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Tables ---------- */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    vertical-align: top;
}

.table th {
    background: var(--ieee-blue);
    color: var(--white);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.table tbody tr:hover { background: var(--ieee-blue-soft); }

.table-bordered { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }

.table-grid th, .table-grid td {
    border: 1px solid var(--border);
}

.table-grid th { background: var(--ieee-blue-light); color: var(--ieee-blue-dark); }

.table-actions { text-align: right; white-space: nowrap; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-draft     { background: #E1E5E9; color: #555; }
.badge-submitted { background: var(--ieee-blue-light); color: var(--ieee-blue-dark); }
.badge-review    { background: var(--amber-bg); color: var(--amber); }
.badge-approved  { background: var(--green-bg); color: var(--green); }
.badge-rejected  { background: var(--red-bg);   color: var(--red); }
.badge-revision  { background: #FFF8C4; color: #7A6300; }

.badge-role {
    background: var(--ieee-blue-light);
    color: var(--ieee-blue-dark);
    border-radius: var(--radius);
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

/* ---------- Alerts / flash ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: var(--green-bg); border-color: #BBE0BD; color: var(--green); }
.alert-error   { background: var(--red-bg);   border-color: #F5C2BD; color: var(--red); }
.alert-warning { background: var(--amber-bg); border-color: #F2D6A0; color: var(--amber); }
.alert-info    { background: var(--ieee-blue-light); border-color: #B8D4E5; color: var(--ieee-blue-dark); }

/* ---------- Login / centered pages ---------- */
.auth-wrap {
    min-height: calc(100vh - 90px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, var(--ieee-blue-soft) 0%, var(--bg) 100%);
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 4px solid var(--ieee-blue);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 6px;
}

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

.auth-card img.logo {
    display: block;
    margin: 0 auto 16px;
    height: 56px;
}

/* ---------- Stat cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}

.stat-card .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

.stat-card .value {
    color: var(--ieee-blue-dark);
    font-size: 28px;
    font-weight: 700;
    margin-top: 4px;
}

/* ---------- Sidebar layout (dashboards) ---------- */
.layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sidebar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 0;
    height: fit-content;
}

.sidebar .sb-section {
    padding: 0 16px 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-top: 8px;
}

.sidebar a {
    display: block;
    padding: 9px 16px;
    border-left: 3px solid transparent;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.sidebar a:hover {
    background: var(--ieee-blue-soft);
    color: var(--ieee-blue-dark);
}

.sidebar a.active {
    background: var(--ieee-blue-light);
    border-left-color: var(--ieee-blue);
    color: var(--ieee-blue-dark);
    font-weight: 600;
}

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

/* ---------- Footer ---------- */
.footer {
    background: var(--ieee-blue-dark);
    color: #C9DCEA;
    padding: 18px 24px;
    text-align: center;
    font-size: 13px;
    margin-top: 40px;
}
.footer a { color: #FFFFFF; }

/* ---------- Misc ---------- */
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.mt-3 { margin-top: 24px; }
.mb-3 { margin-bottom: 24px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 18px;
    color: var(--text-soft);
    cursor: pointer;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-decoration: none;
}

.tab:hover { color: var(--ieee-blue); text-decoration: none; }
.tab.active { color: var(--ieee-blue-dark); border-bottom-color: var(--ieee-blue); font-weight: 600; }

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

.empty-state h3 { color: var(--text-soft); }

.kv-list {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 8px 16px;
    font-size: 14px;
}

.kv-list dt {
    color: var(--text-muted);
    font-weight: 500;
}
.kv-list dd { margin: 0; color: var(--text); }

@media (max-width: 600px) {
    .kv-list { grid-template-columns: 1fr; gap: 2px 0; }
    .kv-list dt { margin-top: 8px; }
}

/* ---------- Print ---------- */
@media print {
    .topbar, .footer, .sidebar, .btn, .tabs, .topnav { display: none !important; }
    .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
    .layout { grid-template-columns: 1fr; }
    body { background: white; }
}
