/**
 * The Taman Dayu Golf Club & Resort
 * Driving Range Management System - Unified Theme CSS (Exact Portal Dimensions & Alignment)
 * Color Palette: Hijau Lapangan (Fairway), Alam Pegunungan (Welirang & Arjuno), Aksen Kemewahan Gold
 */

:root {
    /* 1. Hijau Pegunungan (Dark Pine Canopy & Mountain Mist) */
    --td-pine-dark: #0d2818;
    --td-forest-bar: #133824;
    --td-subbar-bg: #091b10;
    --td-bg-mist: #f4f8f5;
    --td-border-subtle: #dce7e0;

    /* 2. Hijau Lapangan (Fairway & Greens) */
    --td-green-primary: #198754;
    --td-green-dark: #146c43;
    --td-green-deeper: #0f5132;
    --td-green-soft: #eaf5ed;

    /* 3. Aksen Kemewahan Klasik (Resort Gold) */
    --td-gold: #B89047;
    --td-gold-light: #D4AF37;
    --td-gold-glow: rgba(184, 144, 71, 0.28);

    /* 4. Text & Typography */
    --td-text-heading: #0f2417;
    --td-text-body: #283e32;
    --td-text-muted: #627b6c;
}

body.td-body {
    background-color: var(--td-bg-mist);
    color: var(--td-text-body);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* ==========================================================================
   TWO-TIER HEADER & NAVIGATION
   ========================================================================== */
.td-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 4px 15px rgba(13, 40, 24, 0.15);
}

/* Tier 1: Primary Header Bar */
.td-primary-bar {
    background: linear-gradient(135deg, var(--td-pine-dark) 0%, var(--td-forest-bar) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    height: 72px;
    display: flex;
    align-items: center;
}

/* Fixed Logo Dimensions (Copied from portal-oauth & room-inspection: 104px x 46px) */
.td-brand-badge {
    background: #ffffff;
    border-radius: 8px;
    width: 104px;
    height: 46px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.td-brand-badge img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Nav Links Styling - Pixel Perfect Alignment */
nav.td-desktop-nav {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0.25rem;
}

nav.td-desktop-nav .dropdown {
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.td-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    border: 1px solid transparent;
    line-height: 1;
}

.td-nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.td-nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.td-nav-link .bi {
    font-size: 0.88rem;
    margin-right: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.td-nav-link.dropdown-toggle::after {
    margin-left: 0.45rem;
    vertical-align: middle;
}

/* Gold Initial Avatar & Profile Button */
.td-avatar-gold {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--td-gold) 0%, var(--td-gold-light) 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(184, 144, 71, 0.35);
    flex-shrink: 0;
    line-height: 1;
}

.td-profile-btn {
    background: transparent;
    border: none;
    padding: 3px 8px 3px 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    height: 42px;
}

.td-profile-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.td-role-pill {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    line-height: 1.1;
    display: inline-block;
}

.td-role-superadmin {
    background: #dc3545;
    color: #ffffff;
}

.td-role-admin {
    background: #0d6efd;
    color: #ffffff;
}

.td-role-kasir {
    background: var(--td-green-primary);
    color: #ffffff;
}

.td-role-customer {
    background: var(--td-gold);
    color: #ffffff;
}

/* Tier 2: Sub-Bar Context Header */
.td-subbar {
    background-color: var(--td-subbar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: 42px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

.td-breadcrumb-nav {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.td-breadcrumb-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}

.td-breadcrumb-link:hover {
    color: #ffffff;
}

.td-breadcrumb-current {
    color: #ffffff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.td-breadcrumb-separator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.5rem;
    opacity: 0.4;
    line-height: 1;
    vertical-align: middle;
}

/* Status Indicator Capsule */
.td-status-capsule {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1;
}

.td-gold-dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
    min-height: 6px;
    border-radius: 50%;
    background-color: var(--td-gold-light);
    box-shadow: 0 0 6px var(--td-gold-light);
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
    animation: tdPulse 2s infinite ease-in-out;
}

@keyframes tdPulse {
    0% {
        box-shadow: 0 0 0 0 var(--td-gold-glow);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(184, 144, 71, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(184, 144, 71, 0);
    }
}

/* Dropdown Menu Overrides */
.td-dropdown-menu {
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    min-width: 220px;
}

.td-dropdown-item {
    font-size: 12px;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: #334155;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
}

.td-dropdown-item:hover {
    background-color: #f8fafc;
    color: #172a40;
}

.td-dropdown-item.active {
    background-color: var(--td-green-primary) !important;
    color: #ffffff !important;
}

.td-dropdown-item.text-danger:hover {
    background-color: #fee2e2;
    color: #dc2626 !important;
}

/* ==========================================================================
   RESORT APP FOOTER (Fixed Space Logo: 90px x 38px)
   ========================================================================== */
.td-footer-logo-badge {
    background: #ffffff;
    border-radius: 8px;
    width: 90px;
    height: 38px;
    padding: 4px 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dce7e0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.td-footer-logo-badge img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   LUXURY SPLIT-SCREEN LOGIN PAGE
   ========================================================================== */
.td-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    background-color: var(--td-bg-mist);
}

@media (max-width: 991.98px) {
    .td-login-shell {
        grid-template-columns: 1fr;
    }
    .td-login-scenery {
        display: none !important;
    }
}

/* Left Hero Scenery Panel */
.td-login-scenery {
    position: relative;
    background: url('../images/scenery_driving_range.jpg') center center / cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3.5rem;
    color: #ffffff;
    overflow: hidden;
}

.td-login-scenery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13, 40, 24, 0.84) 0%, rgba(19, 56, 36, 0.89) 100%);
    z-index: 1;
}

.td-login-scenery > * {
    position: relative;
    z-index: 2;
}

.td-scenery-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--td-gold-light);
    backdrop-filter: blur(8px);
    line-height: 1;
}

.td-scenery-title {
    font-size: clamp(2rem, 3.2vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin: 1.25rem 0 0.85rem;
}

.td-scenery-desc {
    font-size: 0.98rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.85);
    max-width: 520px;
}

/* Minimalist Feature Pills */
.td-feature-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 2rem;
}

.td-feature-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.85rem 1.15rem;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.td-feature-pill:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(4px);
}

.td-feature-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--td-gold) 0%, var(--td-gold-light) 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    line-height: 1;
}

.td-feature-text h6 {
    margin: 0 0 2px 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.td-feature-text small {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    display: block;
}

/* Right Access Card Panel */
.td-login-access {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: var(--td-bg-mist);
}

.td-login-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border: 1px solid var(--td-border-subtle);
    border-radius: 20px;
    padding: 2.75rem 2.5rem;
    box-shadow: 0 15px 40px rgba(13, 40, 24, 0.06);
    position: relative;
}

.td-login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 4px;
    background: linear-gradient(90deg, var(--td-green-primary) 0%, var(--td-gold) 100%);
    border-radius: 4px 4px 0 0;
}

/* Input Fields with Pixel-Centered Leading Icons */
.td-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.td-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--td-text-muted);
    font-size: 1rem;
    pointer-events: none;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.td-input {
    width: 100%;
    height: 46px;
    padding: 0 1rem 0 2.75rem;
    font-size: 0.9rem;
    border: 1.5px solid var(--td-border-subtle);
    border-radius: 10px;
    transition: all 0.2s ease;
    background-color: #fafdfa;
    color: var(--td-text-body);
    box-sizing: border-box;
}

.td-input:focus {
    background-color: #ffffff;
    border-color: var(--td-green-primary);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15);
    outline: none;
}

.td-input-wrap.has-toggle .td-input {
    padding-right: 2.75rem;
}

.td-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--td-text-muted);
    cursor: pointer;
    padding: 4px 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: color 0.15s ease;
    line-height: 1;
    z-index: 5;
}

.td-password-toggle:hover {
    color: var(--td-text-body);
}

/* Checkbox Alignment Reset */
.td-remember-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.td-remember-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--td-green-primary);
    flex-shrink: 0;
}

.td-remember-wrap label {
    margin: 0;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--td-text-muted);
    user-select: none;
}

/* Submit Button */
.td-btn-submit {
    background: linear-gradient(135deg, var(--td-green-primary) 0%, var(--td-green-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    height: 46px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.25);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.td-btn-submit:hover {
    background: linear-gradient(135deg, var(--td-green-dark) 0%, var(--td-green-deeper) 100%);
    box-shadow: 0 6px 16px rgba(25, 135, 84, 0.35);
    transform: translateY(-1px);
    color: #ffffff;
}

.td-btn-submit:active {
    transform: translateY(0);
}

.td-portal-switch {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--td-border-subtle);
    text-align: center;
    font-size: 0.82rem;
    color: var(--td-text-muted);
}

.td-portal-switch a {
    color: var(--td-green-dark);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.15s ease;
}

.td-portal-switch a:hover {
    color: var(--td-gold);
    text-decoration: underline;
}

/* ==========================================================================
   SEAMLESS PASSWORD INPUT COMPONENT
   ========================================================================== */
.td-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.td-password-wrap .form-control {
    width: 100%;
    padding-right: 2.75rem !important;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.td-password-wrap .form-control:focus {
    border-color: var(--td-green-primary, #198754);
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.2);
}

.td-password-wrap .form-control.is-invalid {
    background-image: none !important;
    border-color: #dc3545;
}

.td-password-wrap .form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.td-password-wrap .btn-toggle-password {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #6c757d;
    padding: 0.375rem 0.75rem;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 5;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.td-password-wrap .btn-toggle-password:hover {
    color: var(--td-pine-dark, #0d2818);
    background-color: rgba(0, 0, 0, 0.04) !important;
}

.td-password-wrap .btn-toggle-password:focus {
    outline: none;
    box-shadow: none !important;
}

