@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
    --background: 0 0% 98%;
    --foreground: 0 0% 8%;

    --card: 0 0% 100%;
    --card-foreground: 0 0% 8%;

    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 8%;

    --primary: 0 84% 33%;
    --primary-foreground: 0 0% 100%;

    --secondary: 120 100% 18%;
    --secondary-foreground: 0 0% 100%;

    --muted: 40 20% 94%;
    --muted-foreground: 0 0% 40%;

    --accent: 0 0% 6%;
    --accent-foreground: 0 0% 100%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;

    --border: 40 15% 88%;
    --input: 40 15% 88%;
    --ring: 0 84% 33%;

    --radius: 1rem;

    --kenya-black: 0 0% 6%;
    --kenya-red: 0 84% 33%;
    --kenya-green: 120 100% 18%;
    --kenya-white: 0 0% 100%;
    --kenya-gold: 40 90% 50%;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Source Sans 3', sans-serif;

    --sidebar-background: 0 0% 98%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-primary: 240 5.9% 10%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 240 4.8% 95.9%;
    --sidebar-accent-foreground: 240 5.9% 10%;
    --sidebar-border: 220 13% 91%;
    --sidebar-ring: 0 84% 33%;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: var(--font-body);
    line-height: 1.7;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('sauti-logo.png') no-repeat center center;
    background-size: 45%;
    opacity: 0.06;
    pointer-events: none;
    z-index: -1;
    filter: blur(0.8px);
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0;
}

header {
    background: hsl(var(--sidebar-background));
    color: hsl(var(--sidebar-foreground));
    padding: 1.5rem 0 0.8rem;
    border-bottom: 1px solid hsl(var(--sidebar-border));
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 88px;
}

.logo span {
    font-size: 0.95rem;
    color: hsl(var(--muted-foreground));
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease;
}

.back-btn:hover {
    background: hsl(var(--secondary));
    transform: translateY(-1px);
}

.user-menu {
    position: relative;
    display: inline-flex;
}

.hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    font-size: 1.15rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.hamburger:hover {
    transform: translateY(-1px);
    background: hsl(var(--secondary));
}

.dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: 260px;
    background: rgba(255, 255, 255, 0.83);
    color: hsl(var(--foreground));
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    z-index: 50;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.dropdown.show {
    display: block;
}

.dropdown .user-info {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
    font-size: 0.95rem;
    line-height: 1.6;
}

.dropdown a {
    display: block;
    padding: 0.95rem 1.2rem;
    color: hsl(var(--foreground));
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown a:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

.menu-tile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: hsl(var(--foreground));
    background: transparent;
    padding: 0.95rem 1.2rem;
    border-bottom: 1px solid hsl(var(--border));
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.menu-tile:hover {
    background: hsl(var(--muted));
}

.menu-tile i {
    font-size: 1.3rem;
    color: hsl(var(--primary));
    flex-shrink: 0;
}

.menu-tile span {
    flex: 1;
}

.menu-tile.logout {
    border-top: 1px solid hsl(var(--border));
    color: hsl(var(--destructive));
}

.menu-tile.logout i {
    color: hsl(var(--destructive));
}

.menu-tile.logout:hover {
    background: hsla(0, 84%, 60%, 0.08);
}

.menu-tile.logout:hover {
    background: hsla(0, 84%, 60%, 0.12);
}

.kenya-stripe {
    height: 4px;
    background: linear-gradient(
        to right,
        hsl(var(--kenya-black)) 0%,
        hsl(var(--kenya-black)) 33%,
        hsl(var(--kenya-red)) 33%,
        hsl(var(--kenya-red)) 50%,
        hsl(var(--kenya-white)) 50%,
        hsl(var(--kenya-white)) 55%,
        hsl(var(--kenya-green)) 55%,
        hsl(var(--kenya-green)) 100%
    );
    border-radius: 999px;
    margin-top: 0.8rem;
}

.card,
.card-secondary {
    background: rgba(255, 255, 255, 0.78);
    color: hsl(var(--card-foreground));
    border-radius: 1.25rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.card {
    padding: 2.25rem;
    margin-bottom: 2rem;
}

.card-secondary {
    padding: 1.5rem;
    margin-top: 1rem;
}

button,
input[type="submit"],
select,
input[type="text"],
input[type="password"],
textarea {
    font: inherit;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid hsl(var(--input));
    border-radius: 1rem;
    margin: 0.75rem 0 1.25rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    font-size: 1rem;
    background: hsl(var(--card));
    color: hsl(var(--foreground));
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 4px rgba(0, 150, 57, 0.12);
}

button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3.2rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    border-radius: 1rem;
    padding: 0.95rem 1.5rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 16px 35px rgba(0, 150, 57, 0.18);
}

button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    background: hsl(var(--secondary));
    box-shadow: 0 20px 40px rgba(0, 150, 57, 0.2);
}

button i,
input[type="submit"] i {
    font-size: 1.1rem;
}

button[data-icon]::before,
input[type="submit"][data-icon]::before {
    font-family: 'boxicons';
    margin-right: 0.5rem;
}

h3 {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-heading);
    margin-top: 0;
}

h3 i {
    font-size: 1.4rem;
    color: hsl(var(--primary));
}

.button-secondary,
select.secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
}

.table th,
.table td {
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid hsl(var(--border));
    text-align: left;
    color: hsl(var(--foreground));
}

.table thead {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
    font-weight: 700;
}

.table tbody tr:hover {
    background: hsl(var(--sidebar-accent));
}

.alert {
    padding: 1rem 1.2rem;
    border-radius: 1rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.alert i {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.alert-success {
    background: hsl(136, 61%, 93%);
    color: hsl(163, 54%, 24%);
    border-color: hsl(var(--primary));
}

.alert-success i {
    color: hsl(163, 54%, 24%);
}

.alert-error {
    background: hsl(354, 96%, 96%);
    color: hsl(354, 82%, 39%);
    border-color: hsl(var(--destructive));
}

.alert-error i {
    color: hsl(354, 82%, 39%);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: hsl(142, 57%, 90%);
    color: hsl(166, 59%, 27%);
    font-size: 0.82rem;
    font-weight: 700;
    margin: 0.3rem 0;
}

.sidebar {
    margin-bottom: 2rem;
}

.sidebar a {
    display: block;
    padding: 0.95rem 1.1rem;
    margin: 0.5rem 0;
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    text-decoration: none;
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.sidebar a:hover {
    transform: translateX(2px);
    background: hsl(var(--muted));
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        height: auto;
        clip-path: none;
    }

    header .container {
        flex-direction: column;
        align-items: stretch;
        position: static;
    }

    .logo {
        width: 100%;
        justify-content: space-between;
        position: static;
    }

    .logo img {
        height: 60px;
    }

    .logo span {
        display: none;
    }

    .user-menu {
        position: static;
        transform: none;
    }

    .dropdown {
        right: 0;
        left: auto;
        width: calc(100% - 32px);
    }

    .container {
        padding: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem 0 0.5rem;
        height: auto;
        clip-path: none;
    }

    .logo img {
        height: 40px;
    }

    .hamburger {
        font-size: 1.5rem;
        padding: 0.5rem;
    }

    .menu-tile {
        padding: 1rem;
        font-size: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .alert {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}
