:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --background: #f3f4f6;
    --surface: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.08);
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-nav {
    display: flex;
    flex: 1;
    gap: 2px;
    align-items: center;
    height: 100%;
}

/* Primary nav link */
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0 12px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.nav-link:hover {
    color: var(--text-main);
    border-bottom-color: var(--primary-color);
}

/* Dropdown container */
.nav-dropdown {
    position: relative;
    height: 56px;
    display: flex;
    align-items: center;
}

/* Dropdown trigger button */
.nav-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0 12px;
    height: 56px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    font-family: inherit;
}
.nav-dropdown-btn:hover,
.nav-dropdown:hover .nav-dropdown-btn {
    color: var(--text-main);
    border-bottom-color: var(--primary-color);
}
.nav-dropdown-btn .chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
}
.nav-dropdown:hover .nav-dropdown-btn .chevron {
    transform: rotate(180deg);
}

/* Dropdown menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.06);
    min-width: 200px;
    padding: 6px 0;
    z-index: 200;
    animation: dropdownIn .12s ease;
}
.nav-dropdown:hover .dropdown-menu {
    display: block;
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Dropdown items */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.dropdown-item:hover {
    background: #f5f3ff;
    color: var(--primary-color);
}
.dropdown-item .item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}
.dropdown-item:hover .item-icon { opacity: 1; }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 5px 0;
}

.dropdown-label {
    padding: 6px 16px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

/* User dropdown — right-aligned */
.nav-dropdown.user-menu .dropdown-menu {
    left: auto;
    right: 0;
}

/* Navbar right side */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
    margin-left: auto;
}

.btn-nav {
    padding: 6px 14px;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
}
.btn-nav:hover {
    background-color: var(--primary-hover);
}

/* Auth Pages */
.auth-container {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.auth-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}

.auth-methods {
    width: 100%;
    max-width: 1000px;
    margin-bottom: 10px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
    /* Important for padding */
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}


.invalid-feedback {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 5rem 2rem;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-hero-primary {
    background-color: white;
    color: var(--primary-color);
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-hero-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-hero-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Features Section */
/* Features Section */
.features-section {
    padding: 5rem 2rem;
    background-color: var(--background);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: var(--surface);
    padding: 2.5rem;
    /* More whitespace */
    border-radius: var(--radius);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Very subtle border */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

/* "Laravel Style" Hover Effect */
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(79, 70, 229, 0.2);
    /* Slight tint of primary on hover */
}

/* Decoration line on top like Laravel docs cards often have or simple accent */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon-wrapper {
    margin-bottom: 1.5rem;
    display: inline-flex;
}

.feature-icon {
    width: 56px;
    height: 56px;
    background-color: #f5f3ff;
    /* Very light primary tint */
    border-radius: 16px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* Feature Icons (Simulated) */
/* Feature Icons */

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.feature-description {
    color: var(--text-muted);
    line-height: 1.625;
    font-size: 1rem;
    margin: 0;
}

/* ========================================
   Settings / Profile Page
   ======================================== */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.settings-header {
    margin-bottom: 2rem;
}

.settings-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 0.25rem;
}

.settings-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.settings-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease;
}

.settings-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.settings-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.settings-card-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background-color: #eef2ff;
    border-radius: 12px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-card-icon.icon-danger {
    background-color: #fef2f2;
    color: #dc2626;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 0.25rem;
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
}

.btn-save {
    width: auto;
    padding: 0.65rem 1.75rem;
    font-size: 0.9rem;
}

/* Success Alert */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-success svg {
    color: #10b981;
    flex-shrink: 0;
}

/* Danger Zone */
.settings-card-danger {
    border-color: #fecaca;
}

.settings-card-danger:hover {
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.06), 0 4px 6px -2px rgba(220, 38, 38, 0.03);
}

.delete-section {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-danger {
    padding: 0.65rem 1.5rem;
    background-color: #dc2626;
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Responsive */
@media (max-width: 640px) {
    .settings-container {
        padding: 1.5rem 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .delete-section {
        flex-direction: column;
        align-items: stretch;
    }

    .delete-section .form-group {
        max-width: 100% !important;
    }
}

/* ========================================
   Page Container / Header (CRUD pages)
   ======================================== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.2rem 0 0;
}

/* ========================================
   Toolbar (Search + Filters)
   ======================================== */
.toolbar {
    margin-bottom: 1.5rem;
}

.toolbar-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.65rem 0.75rem 0.65rem 2.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.filter-select {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--surface);
    cursor: pointer;
    min-width: 160px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-search {
    padding: 0.65rem 1.25rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-search:hover {
    background-color: var(--primary-hover);
}

.btn-clear {
    padding: 0.65rem 1.25rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-clear:hover {
    border-color: var(--text-muted);
    color: var(--text-main);
}

/* ========================================
   Data Table
   ======================================== */
.table-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background-color: #f9fafb;
    border-bottom: 2px solid var(--border);
}

.data-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.15s;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.td-primary {
    font-weight: 600;
}

.th-actions {
    text-align: center;
    width: 100px;
}

.td-actions {
    text-align: center;
    white-space: nowrap;
}

.rfc-code {
    background-color: #f3f4f6;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: 'SFMono-Regular', Consolas, monospace;
    color: var(--text-main);
    letter-spacing: 0.03em;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background-color: #ecfdf5;
    color: #065f46;
}

.badge-info {
    background-color: #eff6ff;
    color: #1e40af;
}

.badge-purple {
    background-color: #f5f3ff;
    color: #5b21b6;
}

.badge-muted {
    background-color: #f3f4f6;
    color: #6b7280;
}

.badge-warning {
    background-color: #fffbeb;
    color: #92400e;
}

/* ========================================
   Action Icon Buttons
   ======================================== */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 2px;
    background: none;
    text-decoration: none;
}

.btn-icon-edit {
    color: var(--primary-color);
}

.btn-icon-edit:hover {
    background-color: #eef2ff;
}

.btn-icon-delete {
    color: #dc2626;
}

.btn-icon-delete:hover {
    background-color: #fef2f2;
}

/* ========================================
   Table Footer / Pagination
   ======================================== */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.825rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-info {
    color: var(--text-muted);
}

.table-footer nav {
    display: flex;
}

.table-footer nav span,
.table-footer nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    margin: 0 2px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.15s;
}

.table-footer nav span[aria-current] {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.table-footer nav a {
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.table-footer nav a:hover {
    background-color: #f3f4f6;
    color: var(--text-main);
}

.table-footer nav span[aria-disabled] {
    color: #d1d5db;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    margin: 0;
}

/* ========================================
   Form Extras (textarea, checkbox)
   ======================================== */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.text-muted {
    color: var(--text-muted);
    font-weight: 400;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-main);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* ========================================
   Responsive (CRUD pages)
   ======================================== */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-form {
        flex-direction: column;
    }

    .search-box,
    .filter-select {
        width: 100%;
        min-width: unset;
    }

    .table-footer {
        flex-direction: column;
        text-align: center;
    }
}