/**
 * The King's Assembly Church - Procurement & Fixed-Asset Management System
 * Design System & Master Stylesheet
 * 
 * Brand Aesthetics: Royal Navy (#071426, #0B1B3D) with Sovereign Gold (#D4AF37, #E5C058)
 * Typography: Montserrat (Headings & Navigation) + Inter (Data & Body)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
    --tka-navy-deep: #071426;
    --tka-navy: #0B1B3D;
    --tka-navy-light: #162B55;
    --tka-gold: #D4AF37;
    --tka-gold-light: #F3D279;
    --tka-gold-dark: #B8860B;
    --tka-gold-gradient: linear-gradient(135deg, #F3D279 0%, #D4AF37 50%, #B8860B 100%);
    --tka-navy-gradient: linear-gradient(180deg, #071426 0%, #0B1B3D 100%);

    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --border-color: #E2E8F0;
    --border-color-subtle: #F1F5F9;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-light: #94A3B8;

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #0284C7;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);
    --shadow-gold: 0 4px 15px rgba(212, 175, 55, 0.25);
}

/* Base Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.55;
    font-size: 14.5px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--tka-navy-deep);
    letter-spacing: -0.02em;
}

a {
    color: var(--tka-navy);
    text-decoration: none;
    transition: all 0.2s ease;
}
a:hover {
    color: var(--tka-gold-dark);
}

/* Church Top Bar */
.tka-topbar {
    background-color: #040D1A;
    color: #94A3B8;
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}
.tka-topbar a {
    color: #CBD5E1;
    font-weight: 500;
    margin-right: 18px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.tka-topbar a:hover {
    color: var(--tka-gold);
}
.tka-live-pill {
    background: #DC2626;
    color: #FFF;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    animation: pulseGlow 2s infinite;
}
@keyframes pulseGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Church Main Header */
.tka-header {
    background: var(--tka-navy-deep);
    color: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(7, 20, 38, 0.4);
    border-bottom: 2px solid var(--tka-gold);
}
.tka-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}
.tka-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}
.tka-brand img {
    height: 48px;
    width: auto;
    object-fit: contain;
}
.tka-brand-title {
    display: flex;
    flex-direction: column;
}
.tka-brand-title .org-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 17px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 0.5px;
    line-height: 1.15;
    text-transform: uppercase;
}
.tka-brand-title .sub-name {
    font-size: 11.5px;
    color: var(--tka-gold);
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Main Nav Links */
.tka-nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}
.tka-nav-item {
    position: relative;
}
.tka-nav-link {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #E2E8F0;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.tka-nav-link:hover, .tka-nav-item.active .tka-nav-link {
    color: var(--tka-gold);
    background: rgba(255, 255, 255, 0.08);
}
.tka-nav-item.active .tka-nav-link {
    background: rgba(212, 175, 55, 0.15);
    color: #FFF;
    border-bottom: 2px solid var(--tka-gold);
}

/* Dropdown Menu */
.tka-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #0B1B3D;
    min-width: 210px;
    padding: 8px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 175, 55, 0.2);
    display: none;
    z-index: 1050;
    list-style: none;
}
.tka-nav-item:hover .tka-dropdown-menu {
    display: block;
}
.tka-dropdown-item {
    font-size: 12.5px;
    font-weight: 500;
    color: #E2E8F0;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}
.tka-dropdown-item:hover {
    background: rgba(212, 175, 55, 0.2);
    color: var(--tka-gold);
    padding-left: 16px;
}
.tka-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px 0;
}

/* User Badge & Actions in Nav */
.tka-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tka-scan-btn {
    background: var(--tka-gold-gradient);
    color: var(--tka-navy-deep);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 12px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-gold);
    border: none;
    cursor: pointer;
    text-transform: uppercase;
}
.tka-scan-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.4);
    color: #000;
}

.tka-user-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 5px 12px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.tka-avatar {
    width: 28px;
    height: 28px;
    background: var(--tka-gold-gradient);
    color: var(--tka-navy-deep);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
}
.tka-user-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.tka-user-name {
    font-size: 12px;
    font-weight: 600;
    color: #FFF;
    line-height: 1.1;
}
.tka-user-role {
    font-size: 10px;
    color: var(--tka-gold);
    text-transform: capitalize;
}

/* Page Layout */
.tka-main-content {
    flex: 1;
    padding: 28px 0 50px 0;
}
.container-custom {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Page Header Banner */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--tka-navy-deep);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Cards */
.card-tka {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    overflow: hidden;
}
.card-tka:hover {
    box-shadow: var(--shadow-md);
}
.card-tka-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-tka-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--tka-navy-deep);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-tka-body {
    padding: 20px;
}

/* Stat Metric Cards */
.stat-card {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--stat-color, var(--tka-gold));
}
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--stat-bg, rgba(212, 175, 55, 0.12));
    color: var(--stat-color, var(--tka-gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.stat-content {
    flex: 1;
}
.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--tka-navy-deep);
    line-height: 1.2;
    margin: 2px 0;
}
.stat-sub {
    font-size: 11.5px;
    color: var(--text-light);
}

/* Buttons */
.btn-navy {
    background-color: var(--tka-navy);
    color: #FFFFFF;
    border: 1px solid var(--tka-navy-deep);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-navy:hover {
    background-color: var(--tka-navy-deep);
    color: var(--tka-gold);
    box-shadow: 0 4px 12px rgba(7, 20, 38, 0.25);
}

.btn-gold {
    background: var(--tka-gold-gradient);
    color: var(--tka-navy-deep);
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-gold);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-gold:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    color: #000;
}

.btn-outline-navy {
    background: transparent;
    color: var(--tka-navy);
    border: 1.5px solid var(--tka-navy);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 13px;
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-outline-navy:hover {
    background: var(--tka-navy);
    color: #FFF;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    line-height: 1;
    letter-spacing: 0.3px;
}
.badge-success { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.badge-warning { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.badge-danger  { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.badge-info    { background: #F0F9FF; color: #0369A1; border: 1px solid #BAE6FD; }
.badge-primary { background: #EEF2FF; color: #4338CA; border: 1px solid #C7D2FE; }
.badge-secondary { background: #F1F5F9; color: #475569; border: 1px solid #CBD5E1; }
.badge-emerald { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.badge-orange  { background: #FFEDD5; color: #C2410C; border: 1px solid #FDBA74; }

/* Filter & Action Bar */
.filter-bar {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}
.filter-search {
    flex: 1;
    min-width: 240px;
    position: relative;
}
.filter-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
}
.filter-search input:focus {
    border-color: var(--tka-navy);
    box-shadow: 0 0 0 2px rgba(11, 27, 61, 0.1);
}
.filter-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    background: #FFF;
    min-width: 140px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}
.table-tka {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.table-tka th {
    background: #F8FAFC;
    color: var(--text-secondary);
    font-family: 'Montserrat', sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}
.table-tka td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.table-tka tr:hover td {
    background-color: #F8FAFC;
}
.table-tka .tag-pill {
    font-family: 'Montserrat', monospace;
    font-weight: 700;
    font-size: 12px;
    color: var(--tka-navy-deep);
    background: #EDF2F7;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Alert Boxes / Notice */
.alert-tka {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
}
.alert-tka-success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.alert-tka-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert-tka-danger  { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.alert-tka-info    { background: #F0F9FF; border: 1px solid #BAE6FD; color: #075985; }

/* Timeline */
.timeline {
    position: relative;
    padding-left: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border-color);
}
.timeline-item {
    position: relative;
    margin-bottom: 20px;
}
.timeline-dot {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--tka-gold);
    border: 3px solid #FFF;
    box-shadow: 0 0 0 1px var(--tka-gold-dark);
}
.timeline-content {
    background: #F8FAFC;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* Church Footer (Exact Match with thekingsassembly.org) */
.tka-footer {
    background: #040D1A;
    color: #94A3B8;
    margin-top: auto;
    border-top: 3px solid var(--tka-gold);
    padding: 50px 0 20px 0;
    font-size: 13.5px;
}
.tka-footer h5 {
    font-family: 'Montserrat', sans-serif;
    color: #FFFFFF;
    font-size: 14.5px;
    font-weight: 700;
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 8px;
}
.tka-footer h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--tka-gold);
}
.tka-footer-motto {
    font-size: 14px;
    color: #E2E8F0;
    line-height: 1.6;
    margin-bottom: 20px;
}
.tka-footer-motto strong {
    color: var(--tka-gold);
    display: block;
    margin-bottom: 4px;
}
.tka-footer ul {
    list-style: none;
}
.tka-footer ul li {
    margin-bottom: 8px;
}
.tka-footer ul li a {
    color: #94A3B8;
    transition: all 0.2s;
}
.tka-footer ul li a:hover {
    color: var(--tka-gold);
    padding-left: 4px;
}
.tka-social-links {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}
.tka-social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}
.tka-social-icon:hover {
    background: var(--tka-gold);
    color: var(--tka-navy-deep);
    transform: translateY(-2px);
}
.tka-footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #64748B;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(7, 20, 38, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-overlay.active {
    display: flex;
}
.modal-container {
    background: #FFF;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    border-top: 4px solid var(--tka-gold);
}
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--tka-navy-deep);
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #F8FAFC;
}

/* Forms */
.form-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--tka-navy-deep);
}
.form-control, .form-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: #FFF;
}
.form-control:focus, .form-select:focus {
    border-color: var(--tka-navy);
    box-shadow: 0 0 0 3px rgba(11, 27, 61, 0.1);
}
.form-text {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Responsive Utilities */
@media (max-width: 992px) {
    .tka-nav-menu {
        display: none;
    }
    .tka-mobile-toggle {
        display: block;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
