/*
 * SGC Infoways Grievance System — theme overrides
 * Loaded after the legacy stylesheets to modernize colors, typography,
 * cards, buttons, tables, and navigation without touching page markup.
 */

:root {
    --sgc-primary: #2554E2;
    --sgc-primary-dark: #1A3FB5;
    --sgc-primary-light: #EAF0FE;
    --sgc-accent: #10B981;
    --sgc-info: #0EA5E9;
    --sgc-warning: #F59E0B;
    --sgc-danger: #E11D48;
    --sgc-bg: #F5F7FB;
    --sgc-surface: #FFFFFF;
    --sgc-text: #1E2433;
    --sgc-muted: #6B7280;
    --sgc-border: #E4E8F0;
    --sgc-radius: 10px;
    --sgc-shadow: 0 1px 3px rgba(30, 36, 51, 0.08), 0 1px 2px rgba(30, 36, 51, 0.06);
    --sgc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --sgc-sidebar-width: 250px;
    --sgc-sidebar-bg: #101B33;
    --sgc-sidebar-text: #A8B3CC;
    --sgc-sidebar-active: #2554E2;
}

html, body {
    background: var(--sgc-bg) !important;
    font-family: var(--sgc-font) !important;
    color: var(--sgc-text);
}

a { color: var(--sgc-primary); }
a:hover, a:focus { color: var(--sgc-primary-dark); }

/* ---------- App shell (sidebar layout) ---------- */
.sgc-shell:not(.sgc-shell-public) {
    display: flex;
    min-height: 100vh;
}

.sgc-sidebar {
    width: var(--sgc-sidebar-width);
    flex-shrink: 0;
    background: linear-gradient(180deg, #101B33, #182A4D);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 20;
}

.sgc-sidebar .sgc-brand { padding: 20px 18px; }
.sgc-sidebar .sgc-brand-name { color: #fff; }
.sgc-sidebar .sgc-brand-tagline { color: var(--sgc-sidebar-text); }

.sgc-sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: 8px 0; }
.sgc-sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.sgc-nav-item { position: relative; }

.sgc-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--sgc-sidebar-text);
    text-decoration: none !important;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}
.sgc-nav-link i:first-child { width: 18px; text-align: center; }
.sgc-nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sgc-nav-link .sgc-nav-caret { margin-left: auto; font-size: 12px; transition: transform 0.2s ease; }

.sgc-nav-item.active > .sgc-nav-link,
.sgc-nav-item > a.sgc-nav-link.active {
    background: var(--sgc-sidebar-active);
    color: #fff;
    border-radius: 8px;
    margin: 0 10px;
    width: calc(100% - 20px);
}

.sgc-nav-toggle { display: none; }
.sgc-nav-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.18);
    transition: max-height 0.25s ease;
}
.sgc-nav-submenu li a {
    display: block;
    padding: 9px 20px 9px 50px;
    color: var(--sgc-sidebar-text);
    text-decoration: none;
    font-size: 13px;
}
.sgc-nav-submenu li a:hover,
.sgc-nav-submenu li a.active { color: #fff; }
.sgc-nav-toggle:checked ~ .sgc-nav-submenu { max-height: 600px; }
.sgc-nav-toggle:checked ~ .sgc-nav-link .sgc-nav-caret { transform: rotate(180deg); }
.sgc-nav-toggle:checked ~ .sgc-nav-link { background: rgba(255, 255, 255, 0.06); color: #fff; }

.sgc-sidebar-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0;
}

.sgc-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--sgc-bg);
}

.sgc-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    background: var(--sgc-surface);
    border-bottom: 1px solid var(--sgc-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sgc-topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 3px;
    background: linear-gradient(90deg, var(--sgc-primary), var(--sgc-accent));
}

.sgc-hamburger {
    display: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--sgc-text);
}

.sgc-topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
}

.sgc-clock {
    color: var(--sgc-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.sgc-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--sgc-text);
    min-width: 0;
}

.sgc-user-pill span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

@media (max-width: 576px) {
    .sgc-clock { display: none; }
    .sgc-user-pill span:last-child { max-width: 110px; }
    .sgc-topbar { padding: 12px 16px; gap: 10px; }
    .sgc-topbar-right { gap: 10px; }
}

.sgc-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sgc-primary-light);
    color: var(--sgc-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.sgc-content { flex: 1 1 auto; padding: 24px 0; }

/* Sidebar layout uses a fluid container, not the fixed Bootstrap-style widths */
.sgc-shell:not(.sgc-shell-public) .sgc-content > .container {
    width: 100%;
    max-width: 1280px;
}

.sgc-sidebar-toggle-input { display: none; }

@media (max-width: 991px) {
    .sgc-shell:not(.sgc-shell-public) .sgc-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }
    .sgc-sidebar-toggle-input:checked ~ .sgc-shell .sgc-sidebar {
        transform: translateX(0);
    }
    .sgc-hamburger { display: inline-flex; }
}

/* ---------- Header / brand (public pages) ---------- */
.header-wrapp {
    background: var(--sgc-surface);
    box-shadow: var(--sgc-shadow);
    border-bottom: 1px solid var(--sgc-border);
    position: relative;
}

.header-wrapp::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 3px;
    background: linear-gradient(90deg, var(--sgc-primary), var(--sgc-accent));
}

.sgc-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.sgc-header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sgc-header-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    color: var(--sgc-text);
    text-decoration: none !important;
}

.sgc-header-nav a:hover {
    background: var(--sgc-primary-light);
    color: var(--sgc-primary-dark);
}

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

.sgc-brand .sgc-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--sgc-primary), var(--sgc-primary-dark));
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.sgc-brand .sgc-brand-text {
    line-height: 1.2;
}

.sgc-brand .sgc-brand-name {
    display: block;
    font-size: 19px;
    font-weight: 700;
    color: var(--sgc-text);
}

.sgc-brand .sgc-brand-tagline {
    display: block;
    font-size: 12px;
    color: var(--sgc-muted);
}

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

.sgc-stat-card {
    background: var(--sgc-surface);
    border: 1px solid var(--sgc-border);
    border-left: 4px solid var(--sgc-primary);
    border-radius: var(--sgc-radius);
    box-shadow: var(--sgc-shadow);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sgc-stat-card:hover { transform: translateY(-2px); }

.sgc-stat-card-warning { border-left-color: var(--sgc-warning); }
.sgc-stat-card-info    { border-left-color: var(--sgc-info); }
.sgc-stat-card-success { border-left-color: var(--sgc-accent); }

.sgc-stat-label {
    display: block;
    color: var(--sgc-muted);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.sgc-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--sgc-text);
}

.sgc-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--sgc-primary-light);
    color: var(--sgc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sgc-stat-icon-warning { background: rgba(245, 158, 11, 0.14); color: var(--sgc-warning); }
.sgc-stat-icon-info    { background: rgba(14, 165, 233, 0.14); color: var(--sgc-info); }
.sgc-stat-icon-success { background: rgba(16, 185, 129, 0.14); color: var(--sgc-accent); }

/* ---------- Cards / content sections ---------- */
.bg-white,
.other-con.bg-gray,
.box-section {
    background: var(--sgc-surface) !important;
}

.other-con {
    padding: 18px 0;
}

.box-section {
    border: 1px solid var(--sgc-border);
    border-radius: var(--sgc-radius);
    box-shadow: var(--sgc-shadow);
    overflow: hidden;
}

.other-important-liks-sec {
    background: var(--sgc-surface);
    border: 1px solid var(--sgc-border);
    border-radius: var(--sgc-radius);
    box-shadow: var(--sgc-shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.other-important-liks-sec h4 {
    font-weight: 700;
    color: var(--sgc-text);
    margin: 0 0 12px;
}

/* ---------- Page header ---------- */
.sgc-page-header {
    padding-left: 14px;
    border-left: 4px solid var(--sgc-primary);
    margin-bottom: 20px;
}

.sgc-page-header h4 {
    margin: 0 0 2px;
    font-weight: 800;
    font-size: 20px;
    color: var(--sgc-text);
}

.sgc-page-header p {
    margin: 0;
    color: var(--sgc-muted);
    font-size: 13px;
}

/* ---------- Chart card ---------- */
.sgc-chart-card { padding: 20px; }

.sgc-tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--sgc-primary-light);
    color: var(--sgc-primary-dark);
    font-size: 13px;
    font-weight: 600;
}

/* ---------- Public landing hero (index.php) ---------- */
.sgc-hero {
    display: flex;
    flex-wrap: wrap;
    min-height: calc(100vh - 260px);
    border-radius: var(--sgc-radius);
    overflow: hidden;
    box-shadow: var(--sgc-shadow);
    margin: 24px 0;
}

.sgc-hero-info {
    position: relative;
    flex: 1 1 480px;
    background: linear-gradient(135deg, var(--sgc-primary), var(--sgc-primary-dark));
    color: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    padding: 48px;
    overflow: hidden;
}

.sgc-hero-info-inner { max-width: 520px; position: relative; z-index: 1; }

.sgc-hero-illustration {
    position: absolute;
    right: -60px;
    bottom: -60px;
    width: 360px;
    height: 360px;
    z-index: 0;
    pointer-events: none;
    color: #fff;
}

.sgc-hero-illustration-light { color: var(--sgc-primary); }

.sgc-hero-illustration svg { width: 100%; height: 100%; }

@media (max-width: 991px) {
    .sgc-hero-illustration { width: 260px; height: 260px; right: -50px; bottom: -50px; }
}

@media (max-width: 767px) {
    .sgc-hero-illustration { display: none; }
}

.sgc-eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 10px;
}

.sgc-hero-title {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 14px;
    line-height: 1.25;
}

.sgc-hero-text {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    margin-bottom: 20px;
}

.sgc-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.sgc-tag-light {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.sgc-hero-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sgc-hero-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    text-decoration: none !important;
    transition: background 0.15s ease, transform 0.15s ease;
}

.sgc-hero-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(2px);
    color: #fff;
}

.sgc-hero-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-size: 16px;
    flex-shrink: 0;
}

.sgc-hero-link strong { display: block; font-size: 14px; }
.sgc-hero-link small { display: block; color: rgba(255, 255, 255, 0.7); font-size: 12px; }

.sgc-hero-login {
    position: relative;
    flex: 1 1 380px;
    background: var(--sgc-surface);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .sgc-hero-login { padding-top: 64px; }
}

.sgc-login-card { position: relative; z-index: 1; width: 100%; max-width: 360px; }
.sgc-login-card.sgc-login-card-wide { max-width: 460px; }
.sgc-login-card h4 { font-weight: 800; margin-bottom: 4px; }
.sgc-login-sub { color: var(--sgc-muted); margin-bottom: 24px; font-size: 13px; }

.sgc-hero-features {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sgc-hero-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 14px;
}

.sgc-hero-features li i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .sgc-hero-info, .sgc-hero-login { padding: 32px 24px; }
    .sgc-hero-title { font-size: 26px; }
}

/* ---------- Standalone auth pages (public/student login) ---------- */
.sgc-auth-page {
    display: flex;
    justify-content: center;
    padding: 48px 16px;
}

.sgc-auth-card {
    width: 100%;
    max-width: 600px;
    background: var(--sgc-surface);
    border: 1px solid var(--sgc-border);
    border-radius: var(--sgc-radius);
    box-shadow: var(--sgc-shadow);
    padding: 40px;
}

.sgc-auth-card-narrow { max-width: 440px; }
.sgc-auth-card h4 { font-weight: 800; margin-bottom: 4px; }

.sgc-captcha-col {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 8px;
}
@media (max-width: 575px) {
    .sgc-captcha-col { margin-top: 0; }
}

.sgc-captcha-img {
    border-radius: 6px;
    border: 1px solid var(--sgc-border);
    height: 42px;
}

.sgc-captcha-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: 1px solid var(--sgc-border);
    border-radius: 6px;
    color: var(--sgc-text);
    text-decoration: none !important;
}
.sgc-captcha-refresh:hover { background: var(--sgc-primary-light); }

/* ---------- Notification ticker ---------- */
.sgc-ticker {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
}

.sgc-ticker-track {
    display: inline-flex;
    align-items: center;
    gap: 28px;
    padding-left: 100%;
    animation: sgc-ticker-scroll 24s linear infinite;
}

.sgc-ticker:hover .sgc-ticker-track { animation-play-state: paused; }

@keyframes sgc-ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

/* ---------- Notification badge ---------- */
.sgc-new-badge {
    display: inline-block;
    background: var(--sgc-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin: 0 2px;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: 6px !important;
    font-weight: 600;
}

.btn-primary {
    background-color: var(--sgc-primary) !important;
    border-color: var(--sgc-primary) !important;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--sgc-primary-dark) !important;
    border-color: var(--sgc-primary-dark) !important;
}

.btn-info {
    background-color: var(--sgc-info) !important;
    border-color: var(--sgc-info) !important;
}

.btn-success {
    background-color: var(--sgc-accent) !important;
    border-color: var(--sgc-accent) !important;
}

.btn-danger {
    background-color: var(--sgc-danger) !important;
    border-color: var(--sgc-danger) !important;
}

.btn-warning {
    background-color: var(--sgc-warning) !important;
    border-color: var(--sgc-warning) !important;
    color: #fff !important;
}

/* ---------- Forms ---------- */
.form-control {
    border-radius: 6px;
    border: 1px solid var(--sgc-border);
}
.form-control:focus {
    border-color: var(--sgc-primary);
    box-shadow: 0 0 0 3px var(--sgc-primary-light);
}

.form-signin h4 { font-weight: 700; }

/* ---------- Tables ---------- */
.table > thead > tr > th {
    background: var(--sgc-primary-light);
    color: var(--sgc-primary-dark);
    border-bottom: none;
    font-weight: 700;
}

.table-responsive {
    border-radius: var(--sgc-radius);
    border: 1px solid var(--sgc-border);
}

/* ---------- Menu bar ---------- */
#menu {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ---------- News / marquee ---------- */
.news-section {
    background: var(--sgc-primary-light);
    border-bottom: none !important;
}

/* ---------- Footer ---------- */
.footer {
    background: var(--sgc-surface);
    border-top: 1px solid var(--sgc-border);
    color: var(--sgc-muted);
}

.footer-left p { color: var(--sgc-muted); }
