@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=DM+Sans:wght@300;400;500;600&display=swap");

:root {
    --primary: #2d6a4f;
    --primary-light: #52b788;
    --accent: #f4a261;
    --dark: #1b1b2f;
    --light: #f8f4f0;
    --white: #ffffff;
    --gray: #6b7280;
    --danger: #ef4444;
    --border: #e5e0d8;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --radius: 16px;
}

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

html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    min-height: 100vh;
    font-family: "DM Sans", sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.main-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cards-grid a {
    text-decoration: none;
    color: var(--dark);
}

.cards-grid a:hover {
    color: var(--white);
}

/*.card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    width: 100%;
}*/

/* NAVBAR */
nav {
    background: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-family: "Playfair Display", serif;
    font-size: 1.6rem;
    color: var(--primary);
    text-decoration: none;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: grid;
    gap: 1.5rem;
    justify-items: center;
    align-items: center;
    grid-template-columns: 1fr 1fr 1fr;
}
.nav-links a {
    text-decoration: none;
    color: var(--gray);
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover {
    color: var(--primary);
}

/* BUTTONS */
.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.25s;
}

#btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: #2a6f51;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 106, 79, 0.35);
}
.btn-accent {
    background: var(--accent);
    color: white;
}
.btn-accent:hover {
    background: #e08c4a;
    transform: translateY(-2px);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}
.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}
.btn-full {
    width: 100%;
    text-align: center;
}

/* HERO */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1e4f3a 100%);
    padding: 5rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero h1 {
    font-family: "Playfair Display", serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    position: relative;
}

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

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.hero-btns a {
    position: relative;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

/* CARDS */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    background: white;
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow);
    transition:
        transform 0.25s,
        box-shadow 0.25s;
    height: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.card-name {
    font-size: 1.1rem;
    font-weight: 600;
}
.card-sub {
    color: var(--gray);
    font-size: 0.85rem;
}

.card-salary-book {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-top: 1rem;
    place-items: start;
}

.badge {
    display: inline-block;
    white-space: nowrap;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green {
    background: #d1fae5;
    color: #065f46;
}
.badge-yellow {
    background: #fef3c7;
    color: #92400e;
}
.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.stars {
    color: var(--accent);
    font-size: 1rem;
}
.tags {
    align-self: flex-start;
    justify-self: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.8rem;
}
.tag {
    background: #e8f5e9;
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* SECTION */
.section {
    display: block;
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.section-title {
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}
.section-sub {
    color: var(--gray);
    margin-bottom: 2rem;
}

/* FORMS */
.form-container {
    max-width: 500px;
    margin: 3rem auto;
    background: white;
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.form-title {
    font-family: "Playfair Display", serif;
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
    color: var(--dark);
}

.form-sub {
    color: var(--gray);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.2rem;
}
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: "DM Sans", sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    background: var(--light);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

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

.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}
.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--primary);
}
.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.divider {
    text-align: center;
    color: var(--gray);
    margin: 1.2rem 0;
    position: relative;
}
.divider::before,
.divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--border);
}
.divider::before {
    left: 0;
}
.divider::after {
    right: 0;
}

.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.role-card {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.role-card:hover,
.role-card.active {
    border-color: var(--primary);
    background: #e8f5e9;
}
.role-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.role-card input[type="radio"] {
    display: none;
}

/* DASHBOARD */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 70px);
}

.sidebar {
    background: var(--dark);
    padding: 2rem 1.2rem;
    color: white;
}

.sidebar-menu {
    list-style: none;
    margin-top: 1.5rem;
}
.sidebar-menu li {
    margin-bottom: 0.4rem;
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}
.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.main-content {
    padding: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-label {
    color: var(--gray);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

/* SEARCH */
.search-bar {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    flex: 1;
    min-width: 180px;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: "DM Sans", sans-serif;
}

/* TABLE */
.table-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    background: var(--dark);
    color: white;
    padding: 1rem;
    text-align: left;
    font-size: 0.85rem;
}
td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
tr:hover td {
    background: var(--light);
}

/* MODAL PAIEMENT */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
}
.modal-title {
    font-family: "Playfair Display", serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.price-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    padding: 1rem;
}

/* UPLOAD */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.upload-area:hover {
    border-color: var(--primary);
    background: #e8f5e9;
}
.upload-area .icon {
    font-size: 2rem;
    color: var(--gray);
}

/* HOW IT WORKS */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}
.step {
    text-align: center;
}
.step-num {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

/* FOOTER */
footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    margin-top: 4rem;
}

footer a {
    color: var(--primary-light);
    text-decoration: none;
}

/* MOBILE MENU BUTTON */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    width: 40px;
    height: 40px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--dark);
    transition: all 0.3s ease;
    border-radius: 3px;
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.mobile-menu-btn span:nth-child(1) {
    top: 10px;
}

.mobile-menu-btn span:nth-child(2) {
    top: 18px;
}

.mobile-menu-btn span:nth-child(3) {
    top: 26px;
}

.mobile-menu-btn.active span:nth-child(1) {
    top: 18px;
    transform: translateX(-50%) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    top: 18px;
    transform: translateX(-50%) rotate(-45deg);
}

/* Mobile menu overlay */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Dashboard content wrapper */
    .dashboard-content {
        padding: 1rem !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .table-wrapper {
        margin-left: -1rem !important;
        margin-right: -1rem !important;
        padding: 0 1rem !important;
    }
    /* Navigation */
    nav {
        padding: 1rem;
        position: relative;
    }

    .mobile-menu-btn {
        display: flex;
        z-index: 1002;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        transition: right 0.3s ease;
        z-index: 1001;
        grid-template-columns: 1fr;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        text-align: left;
        padding: 0.8rem 0;
        border-bottom: 1px solid var(--border);
    }

    #btn-primary {
        margin-top: 1rem;
        text-align: center;
    }

    /* Dashboard */
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

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

    .form-container {
        padding: 1.5rem;
        margin: 1.5rem;
    }

    /* Hero */
    .hero {
        padding: 3rem 1.5rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .hero-btns .btn {
        width: 100%;
        display: block;
        padding: 1rem 1.5rem;
        touch-action: manipulation;
    }

    /* Search */
    .search-bar {
        flex-direction: column;
        padding: 1rem;
    }

    .search-bar input,
    .search-bar select {
        min-width: 100%;
    }

    /* Cards */
    .cards-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem 1rem;
    }

    /* Sections */
    .section {
        padding: 2rem 1rem;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* Steps */
    .steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Tables - make scrollable */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
        max-width: 100%;
    }

    th,
    td {
        padding: 0.7rem 0.5rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Table buttons on mobile */
    table .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        white-space: nowrap;
        min-width: auto;
    }

    table button,
    table .btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.8rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Modal */
    .modal {
        width: 95%;
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.3rem;
    }

    /* Role selector */
    .role-selector {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .hero h1 {
        font-size: 1.5rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .card {
        padding: 1.2rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .stat-card {
        padding: 1rem;
    }

    footer {
        padding: 1.5rem 1rem;
        font-size: 0.8rem;
    }
}
