/* ===================================================
   INVENTARIS KENDARAAN - MAIN CSS
   Modern, Gradient, Elegant, Responsive
   =================================================== */

:root {
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-danger:  linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --gradient-warning: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
    --gradient-info:    linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    --gradient-dark:    linear-gradient(135deg, #232526 0%, #414345 100%);
    --gradient-purple:  linear-gradient(135deg, #8E2DE2 0%, #4A00E0 100%);
    
    /* Colors */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --text-dark: #1a202c;
    --text-muted: #718096;
    --bg-light: #f7fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
    
    /* Sizes */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --navbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===================================================
   AUTH PAGES (Login, Register, etc)
   =================================================== */

.auth-body {
    min-height: 100vh;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    box-shadow: 0 10px 30px rgba(102,126,234,0.4);
}

.auth-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.auth-form { margin-bottom: 20px; }

.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-label i {
    color: var(--primary);
    margin-right: 4px;
}

.form-label .text-danger { color: #e53e3e; }

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

.form-control-lg { padding: 14px 18px; font-size: 15px; }

.input-group-modern {
    position: relative;
}

.input-group-modern .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-group-modern .form-control {
    padding-left: 46px;
}

.btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.btn-toggle-password:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.form-error {
    margin-top: 6px;
    color: #e53e3e;
    font-size: 12px;
}

.form-hint {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ===== CAPTCHA WIDGET ===== */
.captcha-group { margin-bottom: 20px; }

.captcha-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.captcha-input {
    flex: 1;
    font-size: 20px !important;
    font-weight: 700;
    letter-spacing: 6px;
    text-align: center;
}

.captcha-image-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 2px solid var(--border-color);
}

.captcha-image-box img {
    height: 44px;
    border-radius: var(--radius-sm);
    display: block;
}

.btn-captcha-refresh {
    background: var(--gradient-primary);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s;
}

.btn-captcha-refresh:hover {
    transform: rotate(180deg);
}

/* ===== BUTTONS ===== */
.btn-auth-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(102,126,234,0.4);
}

.btn-auth-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102,126,234,0.5);
    color: white;
}

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.link-forgot {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.link-forgot:hover { text-decoration: underline; }

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ===================================================
   APP LAYOUT (sidebar + navbar)
   =================================================== */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--gradient-dark);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 1000;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.brand-name {
    font-weight: 700;
    font-size: 16px;
}

.brand-sub {
    font-size: 11px;
    opacity: 0.7;
}

.sidebar-nav { padding: 20px 12px; }

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4);
    padding: 16px 12px 8px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.nav-item i { width: 20px; text-align: center; }

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-navbar {
    height: var(--navbar-height);
    background: white;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-sidebar-toggle {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-dark);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: none;
}

.page-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light);
    border: none;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.btn-icon:hover {
    background: var(--gradient-primary);
    color: white;
}

.badge-notif {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--gradient-danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.btn-user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-light);
    border: none;
    padding: 6px 14px 6px 6px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-user-dropdown:hover { background: #edf2f7; }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    text-align: left;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-align: left;
}

.app-content {
    flex: 1;
    padding: 24px;
}

.app-footer {
    padding: 16px 24px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===================================================
   CARDS & GRADIENTS
   =================================================== */

.stat-card {
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gradient-primary { background: var(--gradient-primary); }
.gradient-success { background: var(--gradient-success); }
.gradient-danger  { background: var(--gradient-danger); }
.gradient-warning { background: var(--gradient-warning); }
.gradient-info    { background: var(--gradient-info); }
.gradient-purple  { background: var(--gradient-purple); }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.content-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.content-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.content-card-header h5 {
    margin: 0;
    font-weight: 700;
    color: var(--text-dark);
}

.content-card-header i {
    color: var(--primary);
    margin-right: 8px;
}

.content-card-body { padding: 24px; }

.checklist {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.checklist li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.checklist i { font-size: 16px; }

/* ===================================================
   PAGE HEADER
   =================================================== */

.page-header {
    margin-bottom: 24px;
}

.page-heading {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.page-subheading {
    color: var(--text-muted);
    margin: 4px 0 0;
    font-size: 14px;
}

/* ===================================================
   FLASH MESSAGES
   =================================================== */

.flash-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    max-width: 400px;
}

.alert-flash {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    color: white;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s;
    border: none;
}

.alert-flash.alert-success { background: var(--gradient-success); }
.alert-flash.alert-danger  { background: var(--gradient-danger); }
.alert-flash.alert-warning { background: var(--gradient-warning); }
.alert-flash.alert-info    { background: var(--gradient-info); }

.alert-flash .btn-close {
    filter: invert(1);
    opacity: 0.7;
    margin-left: auto;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===================================================
   ERROR PAGES
   =================================================== */

.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-code {
    font-size: 120px;
    font-weight: 900;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 20px;
}

.error-page h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .btn-sidebar-toggle {
        display: flex;
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-backdrop.show {
        display: block;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 32px 24px;
        border-radius: var(--radius-lg);
    }
    .auth-logo {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }
    .auth-title { font-size: 22px; }
    .app-content { padding: 16px; }
    .stat-value { font-size: 26px; }
    .stat-icon { width: 48px; height: 48px; font-size: 20px; }
    .flash-container {
        right: 12px;
        left: 12px;
        max-width: none;
    }
}