:root {
    --prete-green: #1e8f5a;
    --prete-green-dark: #0f5b37;
    --prete-green-deep: #0b4d2f;
    --prete-green-soft: #eaf6ef;
    --prete-white: #ffffff;
    --prete-soft: #f4f7f6;
    --prete-panel: #fbfcfb;
    --prete-border: rgba(15, 91, 55, .10);
    --prete-ink: #183227;
    --prete-ink-soft: #385346;
    --prete-muted: #60756b;
    --prete-sidebar-top: #0f5b37;
    --prete-sidebar-bottom: #0a462b;
    --prete-sidebar-link: rgba(255,255,255,.10);
    --prete-sidebar-link-hover: rgba(255,255,255,.18);
}

html, body { min-height: 100%; }
body {
    background: #f2f5f3;
    color: var(--prete-ink);
    font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.98rem;
    letter-spacing: .01em;
    line-height: 1.55;
}
.auth-body { background: linear-gradient(135deg, #edf3ef 0%, #ffffff 100%); }
.app-body { background: linear-gradient(180deg, #f3f6f4 0%, #eef3f0 100%); }

a { transition: all .18s ease; }

.sidebar {
    width: 335px;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--prete-sidebar-top), var(--prete-sidebar-bottom));
    box-shadow: 18px 0 34px rgba(8, 47, 28, .16);
    position: relative;
}
.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,.08), transparent 32%),
        linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%);
    pointer-events: none;
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar-top { position: sticky; top: 0; }
.logo-panel-clean {
    background: rgba(255,255,255,.98);
    border-radius: 26px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 18px 34px rgba(0,0,0,.14);
}
.logo-img {
    width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.logo-img-xl {
    max-width: 250px;
    max-height: 160px;
}
.sidebar-user {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    padding: 14px 16px;
}
.sidebar-user-name {
    color: #fff !important;
    font-size: 1rem;
    font-weight: 700;
}
.sidebar-user-role {
    color: rgba(255,255,255,.82) !important;
    font-size: .82rem;
}
.sidebar-section-label {
    margin-top: 14px;
    margin-bottom: 4px;
    padding: 8px 12px;
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: rgba(255,255,255,.60);
}
.sidebar .nav-link {
    border-radius: 16px;
    padding: 13px 14px;
    background: var(--prete-sidebar-link);
    color: #f8fffb !important;
    font-weight: 600;
    font-size: .96rem;
    line-height: 1.3;
    border: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    min-height: 48px;
}
.sidebar .nav-link i {
    font-size: 1rem;
    opacity: .95;
}
.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    background: var(--prete-sidebar-link-hover);
    border-color: rgba(255,255,255,.18);
    transform: translateX(2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.sidebar .nav-link.nav-link-logout {
    background: rgba(255,255,255,.14);
    font-weight: 700;
}

.main-content { min-height: 100vh; }

.app-header {
    z-index: 5;
    background: rgba(255,255,255,.92) !important;
    border-bottom: 1px solid rgba(15, 91, 55, .08);
    backdrop-filter: blur(10px);
}
.header-kicker {
    color: var(--prete-muted);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .10em;
    font-weight: 700;
}
.header-title {
    color: var(--prete-green-deep);
    font-weight: 800;
    letter-spacing: -.02em;
}
.header-subtitle { color: #6a7f74; }
.header-user-card {
    background: #ffffff;
    border: 1px solid var(--prete-border);
    border-radius: 16px;
    padding: .75rem .95rem;
    min-width: 220px;
}
.notification-chip {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    border-radius: 999px;
    background: #eef7f2;
    color: var(--prete-green-deep);
    border: 1px solid #d5eadd;
    font-weight: 700;
}

.hero-banner {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    background: linear-gradient(135deg, #ffffff, #f1f7f3);
    border: 1px solid var(--prete-border);
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 12px 28px rgba(19, 50, 35, .04);
}
.hero-badges { display:flex; gap:10px; flex-wrap:wrap; }
.hero-chip {
    display:inline-flex;
    align-items:center;
    padding:11px 15px;
    background:#fff;
    border:1px solid var(--prete-border);
    border-radius:999px;
    font-weight:700;
    color:var(--prete-green-deep);
}

.card, .kpi-box, .alert-panel, .role-card, .notification-panel {
    border-radius: 24px !important;
    border: 1px solid rgba(17, 68, 44, .08) !important;
    box-shadow: 0 12px 30px rgba(17, 68, 44, .05);
    background: #fff;
}
.stat-card {
    background: linear-gradient(180deg, #ffffff, #f8fbf9);
}
.premium-card .card-header,
.card .card-header {
    background: transparent !important;
}
.card-header h5,
.card-header h6 {
    font-weight: 800;
    color: var(--prete-green-deep);
}
.kpi-box {
    background: linear-gradient(180deg, #ffffff, #f5faf7);
    border: 1px solid rgba(30, 143, 90, .12);
    padding: 18px;
}
.alert-panel {
    background:#fbfdfc;
    padding:16px;
    height:100%;
}
.role-card {
    background:#fbfdfc;
    padding:16px;
}

.quick-links-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.quick-link {
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:72px;
    text-decoration:none;
    color:#145937;
    background:#f8fdf9;
    border:1px solid rgba(30,143,90,.12);
    border-radius:18px;
    font-weight:700;
    text-align:center;
    padding: 12px;
}
.quick-link:hover { background:#eff9f2; color:#0f4f31; }

.form-control, .form-select, textarea {
    border-radius: 16px;
    border-color: #d6e4db;
    color: var(--prete-ink);
    min-height: 48px;
    padding: .8rem .95rem;
    background: #fff;
}
textarea.form-control { min-height: 120px; }
.form-control::placeholder, textarea::placeholder { color: #99ab9f; }
.form-control:focus, .form-select:focus, textarea:focus {
    border-color: var(--prete-green);
    box-shadow: 0 0 0 .22rem rgba(30,143,90,.12);
}
.form-label {
    color: var(--prete-green-deep);
    font-weight: 700;
    margin-bottom: .45rem;
}
.btn-success {
    background: linear-gradient(180deg, var(--prete-green), var(--prete-green-dark));
    border-color: var(--prete-green-dark);
    border-radius: 15px;
    font-weight: 800;
    min-height: 48px;
    box-shadow: 0 10px 22px rgba(16, 94, 58, .16);
}
.btn-success:hover, .btn-success:focus {
    background: linear-gradient(180deg, #239864, #0f5b37);
    border-color: #0f5b37;
}
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-success,
.btn-outline-danger {
    border-radius: 14px;
}
.alert {
    border-radius: 18px;
    border: 1px solid transparent;
}
.alert-success { background: #edf8f0; border-color: #cee7d7; color: #145533; }
.alert-danger { background: #fff3f3; border-color: #f2d2d2; color: #8b3131; }
.text-success, .text-success-emphasis { color: var(--prete-green-dark)!important; }
.text-muted { color: #70857a !important; }
.small-muted { font-size:.86rem; color:var(--prete-muted); }
.tiny-muted { font-size:.79rem; }

.table-responsive {
    border-radius: 0 0 24px 24px;
}
.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}
.table thead th {
    white-space: nowrap;
    color: var(--prete-green-deep);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 800;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom-color: #e7eeea;
    background: #f9fcfa;
}
.table td, .table th {
    vertical-align: middle;
    padding: 1rem .9rem;
    border-color: #eef2ef;
}
.table tbody tr:hover {
    background: #fbfdfc;
}

.badge { font-weight: 700; letter-spacing: .02em; }
.calendar-item { display:flex; gap:14px; align-items:flex-start; padding:12px 0; border-bottom:1px solid #eef3ef; }
.calendar-item:last-child { border-bottom:0; }
.calendar-date { min-width:100px; font-weight:800; color:var(--prete-green-deep); }
.gantt-wrapper { overflow:auto; }
.gantt-track { position:relative; height:24px; background:linear-gradient(90deg,#f3f5f4,#fafafa); border-radius:999px; overflow:hidden; }
.gantt-bar { height:100%; background:linear-gradient(90deg,#1e8f5a,#36b877); border-radius:999px; color:#fff; display:flex; align-items:center; justify-content:center; font-size:12px; white-space:nowrap; }

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.08fr .92fr;
}
.login-left {
    background: linear-gradient(155deg, var(--prete-sidebar-top), var(--prete-sidebar-bottom));
    padding: 54px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.login-left::after {
    content:"";
    position:absolute;
    right:-120px;
    top:-120px;
    width:340px;
    height:340px;
    border-radius:50%;
    background:rgba(255,255,255,.06);
}
.login-right {
    display:flex;
    align-items:center;
    justify-content:center;
    padding:32px;
    background: linear-gradient(180deg, #f3f6fa, #edf2ef);
}
.login-brand-stacked {
    display:block;
    position:relative;
    z-index:1;
}
.login-logo-card {
    background: rgba(255,255,255,.98);
    border-radius: 28px;
    padding: 20px;
    display: inline-block;
    box-shadow: 0 20px 34px rgba(0,0,0,.18);
}
.login-logo {
    object-fit: contain;
    display: block;
}
.login-logo-xl {
    width: 100%;
    max-width: 360px;
    max-height: 220px;
}
.login-overline {
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.82);
    margin-bottom: 10px;
}
.login-title {
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.02em;
    max-width: 760px;
}
.login-card-panel {
    padding: 28px;
    border-radius: 28px;
    background: rgba(255,255,255,.10);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.12);
    position: relative;
    z-index: 1;
}
.login-welcome {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 10px;
}
.login-message {
    font-size: 1.02rem;
    line-height: 1.8;
    color: rgba(255,255,255,.94);
    max-width: 780px;
}
.login-feature-list {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}
.login-feature-list span {
    display:block;
    padding:14px 16px;
    border-radius:18px;
    background:rgba(255,255,255,.12);
    color:#fff;
    font-size:.98rem;
    font-weight:700;
}
.login-form-card {
    max-width: 580px;
    width: 100%;
    border-radius: 28px !important;
}
.login-form-card .card-body {
    padding: 42px 40px;
}
.login-form-card h3 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--prete-green-deep);
}
.login-form-card .form-label {
    font-weight: 700;
    color: #244237;
}

.audit-item:last-child { border-bottom: 0 !important; margin-bottom: 0 !important; padding-bottom: 0 !important; }

@media (max-width: 1199px) {
    .sidebar { width: 300px; }
    .login-shell { grid-template-columns: 1fr; }
}

@media (max-width: 991px) {
    .sidebar { width: 96px; }
    .sidebar .nav-link { font-size: 0; justify-content: center; padding: 12px; }
    .sidebar .nav-link i { margin-right: 0 !important; font-size: 1.05rem; }
    .sidebar-section-label, .sidebar-user, .logo-panel-clean { display: none; }
    .quick-links-grid { grid-template-columns: 1fr; }
    .hero-banner { flex-direction: column; align-items: flex-start; }
    .login-left { padding: 30px; }
    .login-title { font-size: 1.9rem; }
    .login-feature-list { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .header-user-card { min-width: auto; }
    .hero-banner { padding: 20px; }
    .login-right { padding: 20px; }
    .login-form-card .card-body { padding: 28px 22px; }
    .login-logo-xl { max-width: 280px; }
}
