* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f3f4f6;
    color: #111827;
}

.login-page {
    position: relative;
    min-height: 100vh;
    background: #000;
    overflow: hidden;
}

.login-page #app {
    min-height: calc(100vh - 70px);
}

.login-page #login-screen,
.login-page #register-screen,
.login-page #individual-register-screen,
.login-page #company-register-screen,
.login-page #forgot-password-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.login-background-slider {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.login-bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.login-bg-slide.active {
    opacity: 1;
}

/* Global page container for consistent width */
.container,
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Global back link styling */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.back-link:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Login & Register */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px;
    background: rgba(255,255,255,0.58);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15,23,42,0.55);
    backdrop-filter: blur(6px);
}

.login-container h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-container input,
.login-container select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-container input:focus,
.login-container select:focus {
    outline: none;
    border-color: #3498db;
}

.login-container select {
    background: white;
    cursor: pointer;
}

/* Password field with eye icon */
.password-field {
    position: relative;
}

.password-field input {
    width: 100%;
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    user-select: none;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.toggle-password:hover {
    opacity: 1;
}

.toggle-password.active {
    opacity: 1;
}

.login-container button {
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
}

.login-container button:hover {
    background: #2980b9;
}

.error {
    color: #e74c3c;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
}

.success {
    color: #27ae60;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
}

.switch-form {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.switch-form a {
    color: #2563eb;
    text-decoration: none;
}

/* Navbar */
.navbar {
    background: #ffffff;
    color: #111827;
    padding: 14px 28px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}

.navbar-brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #2563eb;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.navbar-links a {
    color: #4b5563;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

/* By default, hide items that should only appear in the dropdown (mobile) menu */
.navbar-links a.nav-dropdown-only {
    display: none;
}

.navbar-links a:hover {
    background: #e5e7eb;
    color: #111827;
}

.navbar-links a.active {
    background: #2563eb;
    color: #ffffff;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
}

/* Hamburger menu toggle (used on small screens) */
.nav-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 6px;
}

.btn-notifications {
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s, transform 0.2s;
}

.btn-notifications:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

.btn-notifications-count {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #facc15;
    color: #111827;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout {
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.btn-logout:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: scale(1.05);
}

.nav-brand {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-menu a {
    color: #4b5563;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.nav-menu a:hover {
    background: #e5e7eb;
    color: #111827;
}

@media (max-width: 1200px) {
    .navbar {
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 10px;
        padding: 10px 14px;
        position: relative;
    }

    .navbar-brand {
        flex: 0 0 auto;
    }

    .navbar-user {
        margin-left: auto;
        flex: 0 0 auto;
    }

    .nav-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide icon buttons on small screens; use dropdown items instead */
    .navbar-user .btn-notifications,
    .navbar-user .btn-logout {
        display: none;
    }

    .navbar-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #ffffff;
        padding: 8px 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
        flex-direction: column;
        gap: 6px;
        z-index: 900;
    }

    .navbar-links a {
        padding: 6px 0;
        width: 100%;
    }

    /* On small screens, show the dropdown-only items instead of icon buttons */
    .navbar-links a.nav-dropdown-only {
        display: block;
    }

    .navbar-links.mobile-open {
        display: flex;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 20px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    color: #111827;
    font-size: 22px;
}

/* Buttons */
.btn-primary {
    padding: 9px 18px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(15,23,42,0.06);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 10px rgba(37,99,235,0.25);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(15,23,42,0.25);
}

.btn-secondary {
    padding: 8px 16px;
    background: #e5e7eb;
    color: #111827;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 5px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-secondary:hover {
    background: #d1d5db;
    border-color: #9ca3af;
}

.btn-danger {
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 5px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 36px;
    color: #3498db;
    margin-bottom: 10px;
}

.stat-card p {
    color: #7f8c8d;
    font-size: 14px;
}

/* Table */
table {
    width: 100%;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15,23,42,0.06);
    border-collapse: separate;
    border-spacing: 0;
}

table thead {
    background: #f9fafb;
    color: #4b5563;
}

table th, table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
}

table tbody tr:hover {
    background: #f3f4f6;
}

table tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

/* Wrapper for horizontally scrollable tables (desktop / default) */
.table-responsive-wrap {
    width: 100%;
    overflow-x: auto;
}

/* Opt‑in mobile stacked table layout */
@media (max-width: 640px) {
    /* Only affect tables that explicitly opt in */
    .responsive-table {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        border-collapse: collapse;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table th,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tbody tr {
        margin-bottom: 8px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 6px 8px;
        background: #ffffff;
    }

    .responsive-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f3f4f6;
        font-size: 12px;
        gap: 6px;
        padding: 6px 4px;
    }

    .responsive-table td:last-child {
        border-bottom: none;
        margin-top: 4px;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: #6b7280;
        font-size: 11px;
    }

    /* Utility to hide columns on mobile when needed */
    .col-mobile-hide {
        display: none !important;
    }
}

/* Site-wide default: make all tables easier to read on small screens */
@media (max-width: 640px) {
    table {
        font-size: 12px;
        border-radius: 0;
        box-shadow: none;
        border-collapse: collapse;
    }

    table thead {
        display: none;
    }

    table,
    table tbody,
    table tr,
    table th,
    table td {
        display: block;
        width: 100%;
    }

    table tbody tr {
        margin-bottom: 8px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 6px 8px;
        background: #ffffff;
    }

    table tbody tr:last-child {
        margin-bottom: 0;
    }

    table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f3f4f6;
        font-size: 12px;
        gap: 6px;
        padding: 6px 4px;
    }

    table td:last-child {
        border-bottom: none;
        margin-top: 4px;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: #6b7280;
        font-size: 11px;
    }
}

/* Cards */
.card {
    background: #ffffff;
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15,23,42,0.06);
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 10px;
    color: #111827;
}

/* Feature icons: clean inline icons with consistent size (no background) */
.feature-icon {
    font-size: 28px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

/* Optional colour tweaks */
.feature-icon.icon-orange { color: #f97316; }
.feature-icon.icon-purple { color: #8b5cf6; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Shared inner modal content container (used on pages that use .modal-content inside a full-screen .modal overlay) */
.modal-content {
    background-color: #ffffff;
    margin: 3% auto;
    padding: 28px 26px 24px;
    border-radius: 16px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    border: 1px solid #e5e7eb;
}

.modal h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.modal form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

.modal input, .modal select, .modal textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.modal textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #2ecc71;
    color: white;
}

.badge-warning {
    background: #f39c12;
    color: white;
}

.badge-danger {
    background: #e74c3c;
    color: white;
}

.badge-info {
    background: #3498db;
    color: white;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state h3 {
    margin-bottom: 10px;
}

/* Account Type Selector */
.account-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.account-type-card {
    background: rgba(248,249,250,0.46);
    border: 2px solid rgba(233,236,239,0.85);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.account-type-card:hover {
    border-color: #3498db;
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.2);
}

.account-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.account-type-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 20px;
}

.account-type-card p {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 20px;
}

.account-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.account-features li {
    padding: 8px 0;
    color: #555;
    font-size: 14px;
}

.select-btn {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.select-btn:hover {
    background: #2980b9;
}

.account-type-card:hover .select-btn {
    background: #2980b9;
}

/* Responsive for account type selector */
@media (max-width: 768px) {
    .account-type-selector {
        grid-template-columns: 1fr;
    }
    
    .login-container {
        max-width: 90%;
        margin: 50px auto;
        padding: 30px 20px;
    }
}

/* Global responsive tweaks */
@media (max-width: 1024px) {
    .container {
        margin: 24px auto;
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 20px auto;
        padding: 0 14px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 16px auto;
        padding: 0 12px;
    }
}

/* Make login container wider for account type selection */
#register-screen .login-container {
    max-width: 800px;
}

#individual-register-screen .login-container,
#company-register-screen .login-container {
    max-width: 500px;
}

/* Public navbar overrides: keep Sign up pill-shaped even on login page */
.public-menu-actions .btn-primary {
    border-radius: 999px;
    padding: 8px 16px;
}
