/* =========================================================
   TERA TVET ERP - PROFESSIONAL DESIGN SYSTEM
   UI styling only. No application business logic changed.
   ========================================================= */

:root {
    --tera-navy: #102c46;
    --tera-navy-deep: #0b2035;
    --tera-navy-soft: #183e5e;
    --tera-gold: #d6a84b;
    --tera-gold-light: #f1dfb7;

    --tera-bg: #f4f7fb;
    --tera-surface: #ffffff;
    --tera-text: #1c2b3a;
    --tera-muted: #728195;
    --tera-border: #e5ebf2;

    --tera-success: #16845b;
    --tera-warning: #b7791f;
    --tera-danger: #c24141;
    --tera-info: #2876b8;

    --tera-radius: 14px;
    --tera-radius-sm: 9px;

    --tera-shadow:
        0 8px 28px rgba(22, 42, 66, .055);

    --tera-shadow-hover:
        0 14px 34px rgba(22, 42, 66, .11);
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--tera-bg);
    color: var(--tera-text);
    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--tera-navy-soft);
    text-decoration: none;
    transition: color .2s ease;
}

a:hover {
    color: var(--tera-gold);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--tera-navy);
    font-weight: 700;
    letter-spacing: -.025em;
}

h1 {
    font-size: clamp(1.65rem, 3vw, 2.15rem);
}

h2 {
    font-size: 1.55rem;
}

h3 {
    font-size: 1.2rem;
}

p {
    color: inherit;
}

/* Navigation */

.navbar {
    background: var(--tera-navy) !important;
    border-bottom: 3px solid var(--tera-gold);
    box-shadow: 0 4px 18px rgba(8, 29, 49, .13);
    padding: 12px 0;
}

.navbar .navbar-brand {
    color: #fff !important;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .035em;
}

.navbar .nav-link {
    color: rgba(255,255,255,.78) !important;
    font-weight: 600;
    padding: 9px 13px !important;
    border-radius: 8px;
    transition: all .2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,.10);
}

.navbar-toggler {
    border-color: rgba(255,255,255,.3) !important;
}

/* Main page surface */

.container,
.container-fluid {
    --bs-gutter-x: 1.5rem;
}

main {
    min-height: calc(100vh - 150px);
    padding-top: 28px;
    padding-bottom: 40px;
}

.page-header,
.tera-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 26px;
}

.page-header h1,
.tera-page-header h1 {
    margin: 0;
}

.page-subtitle {
    color: var(--tera-muted);
    margin-top: 5px;
    margin-bottom: 0;
}

/* Cards */

.card {
    background: var(--tera-surface);
    border: 1px solid var(--tera-border);
    border-radius: var(--tera-radius);
    box-shadow: var(--tera-shadow);
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--tera-border);
    padding: 17px 21px;
    border-radius: var(--tera-radius) var(--tera-radius) 0 0 !important;
    font-weight: 700;
    color: var(--tera-navy);
}

.card-body {
    padding: 21px;
}

.card-footer {
    background: #fbfcfe;
    border-top: 1px solid var(--tera-border);
    padding: 14px 21px;
    border-radius: 0 0 var(--tera-radius) var(--tera-radius) !important;
}

.shadow-sm {
    box-shadow: var(--tera-shadow) !important;
}

/* Dashboard statistics */

.tera-stat-card {
    position: relative;
    overflow: hidden;
    height: 100%;
    padding: 23px;
    background: #fff;
    border: 1px solid var(--tera-border);
    border-radius: var(--tera-radius);
    box-shadow: var(--tera-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}

.tera-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--tera-shadow-hover);
}

.tera-stat-card::after {
    content: "";
    position: absolute;
    width: 105px;
    height: 105px;
    right: -35px;
    top: -38px;
    border-radius: 50%;
    background: rgba(214,168,75,.10);
}

.tera-stat-label {
    display: block;
    color: var(--tera-muted);
    font-size: .83rem;
    font-weight: 600;
    margin-bottom: 9px;
}

.tera-stat-value {
    color: var(--tera-navy);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
}

.tera-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    border-radius: 12px;
    background: #edf3f8;
    color: var(--tera-navy);
    font-size: 1.2rem;
}

/* Buttons */

.btn {
    border-radius: 9px;
    padding: 9px 16px;
    font-weight: 650;
    font-size: .88rem;
    transition: all .2s ease;
}

.btn-primary {
    background: var(--tera-navy);
    border-color: var(--tera-navy);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--tera-navy-soft);
    border-color: var(--tera-navy-soft);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--tera-gold);
    border-color: var(--tera-gold);
    color: var(--tera-navy-deep);
}

.btn-warning:hover {
    background: #c69739;
    border-color: #c69739;
    color: var(--tera-navy-deep);
}

.btn-outline-primary {
    color: var(--tera-navy);
    border-color: var(--tera-navy);
}

.btn-outline-primary:hover {
    background: var(--tera-navy);
    border-color: var(--tera-navy);
}

/* Forms */

.form-label {
    color: var(--tera-navy);
    font-weight: 650;
    font-size: .88rem;
    margin-bottom: 7px;
}

.form-control,
.form-select {
    min-height: 43px;
    border: 1px solid #dce4ed;
    border-radius: var(--tera-radius-sm);
    background-color: #fff;
    color: var(--tera-text);
    padding: 9px 12px;
    font-size: .9rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--tera-navy-soft);
    box-shadow: 0 0 0 3px rgba(24,62,94,.10);
}

textarea.form-control {
    min-height: 110px;
}

.form-text {
    color: var(--tera-muted);
}

/* Tables */

.table-responsive {
    border-radius: 10px;
}

.table {
    color: var(--tera-text);
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead th {
    background: #f4f7fa;
    color: #526479;
    border-bottom: 1px solid var(--tera-border);
    font-size: .77rem;
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 14px 15px;
}

.table tbody td {
    padding: 14px 15px;
    border-color: #edf1f5;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* Status indicators */

.badge {
    border-radius: 30px;
    padding: 6px 10px;
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .015em;
}

.bg-success {
    background-color: #dff5e9 !important;
    color: #14734d !important;
}

.bg-warning {
    background-color: #fff1d3 !important;
    color: #926016 !important;
}

.bg-danger {
    background-color: #fde5e5 !important;
    color: #a83232 !important;
}

.bg-info {
    background-color: #e0f0ff !important;
    color: #21649a !important;
}

/* Alerts */

.alert {
    border: 0;
    border-radius: 11px;
    padding: 14px 17px;
}

/* Dropdowns */

.dropdown-menu {
    border: 1px solid var(--tera-border);
    border-radius: 11px;
    padding: 7px;
    box-shadow: var(--tera-shadow-hover);
}

.dropdown-item {
    border-radius: 7px;
    padding: 9px 12px;
    font-size: .88rem;
}

.dropdown-item:hover {
    background: #f0f4f8;
    color: var(--tera-navy);
}

/* Pagination */

.pagination {
    gap: 4px;
}

.page-link {
    color: var(--tera-navy);
    border-radius: 7px !important;
    border-color: var(--tera-border);
}

.page-item.active .page-link {
    background: var(--tera-navy);
    border-color: var(--tera-navy);
}

/* Footer */

footer,
.footer {
    background: #fff;
    color: var(--tera-muted);
    border-top: 1px solid var(--tera-border);
    padding: 19px 0;
    font-size: .82rem;
}

/* Utility surfaces */

.tera-panel {
    background: #fff;
    border: 1px solid var(--tera-border);
    border-radius: var(--tera-radius);
    box-shadow: var(--tera-shadow);
    padding: 22px;
}

.tera-section-title {
    color: var(--tera-navy);
    font-size: 1.05rem;
    font-weight: 750;
    margin-bottom: 17px;
}

.tera-muted {
    color: var(--tera-muted);
}

.tera-divider {
    border-color: var(--tera-border);
    opacity: 1;
}

/* Login and setup forms */

.tera-auth-page {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px 15px;
    background:
        radial-gradient(circle at 10% 10%, rgba(214,168,75,.13), transparent 28%),
        linear-gradient(135deg, #edf2f7, #f8fafc);
}

.tera-auth-card {
    width: 100%;
    max-width: 490px;
    background: #fff;
    border: 1px solid var(--tera-border);
    border-radius: 19px;
    box-shadow: 0 20px 55px rgba(16,44,70,.12);
    padding: clamp(24px, 5vw, 40px);
}

.tera-auth-brand {
    color: var(--tera-navy);
    font-size: 1.8rem;
    font-weight: 850;
    letter-spacing: .05em;
}

.tera-auth-accent {
    width: 48px;
    height: 4px;
    border-radius: 5px;
    background: var(--tera-gold);
    margin: 12px 0 22px;
}

/* Responsive adjustments */

@media (max-width: 767.98px) {
    main {
        padding-top: 20px;
    }

    .card-body {
        padding: 16px;
    }

    .tera-stat-card {
        padding: 18px;
    }

    .tera-stat-value {
        font-size: 1.65rem;
    }

    .page-header,
    .tera-page-header {
        align-items: flex-start;
    }

    .table thead th,
    .table tbody td {
        padding: 11px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
