/* ========== RESET DE BAZĂ ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #eef2ff, #e0ecff);
    color: #111827;
    overflow-x: hidden;

    /* ca să nu fie acoperit conținutul de header+nav FIXE */
    padding-top: 120px; /* ajustezi dacă vrei mai mult sau mai puțin spațiu */
}

/* ========== HEADER SUS (LOGO + TITLU) ========== */

header {
    width: 100%;
    background: #020617;
    color: #e5e7eb;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;

    /* FIX SUS ÎN VIEWPORT */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;

    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.5);
}

header h1 {
    font-size: 20px;
    font-weight: 600;
}

header .subtitle {
    font-size: 13px;
    color: #9ca3af;
}

/* ========== NAV (BUTOANE SUS SUB HEADER) ========== */

nav {
    width: 100%;
    background: #020617;
    color: #e5e7eb;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    /* FIX sub header – înălțimea header-ului ~ 56-60px */
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 999;

    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.4);
}

.nav-left,
.nav-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Butoanele din nav ocupă doar spațiul lor */
nav .btn {
    width: auto;
}

/* ========== CONȚINUT PRINCIPAL ========== */

main {
    width: 100%;
    padding: 16px;
}

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

/* Card de bun venit / panou de info */
.welcome-card {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    margin: 16px 0;
}

.welcome-card h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

.welcome-subtitle {
    font-size: 14px;
    color: #6b7280;
}

/* ========== GRID DASHBOARD (INDEX) ========== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* Desktop mare */
    gap: 16px;
}

/* Card/tile */
.tile {
    background: #ffffff;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
}

.tile h3 {
    margin-bottom: 8px;
    font-size: 16px;
}

.tile p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #555555;
}

.tile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ========== BUTOANE (TOATE ALBASTRE, TEXT ALB) ========== */

.btn,
button,
input[type="submit"],
input[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.16s ease;
    white-space: nowrap;
    background-color: #2563eb; /* albastru */
    color: #ffffff;            /* text alb */
}

/* Primar – un albastru puțin mai închis */
.btn-primary {
    background-color: #1d4ed8;
    color: #ffffff;
}

/* Secundar – tot albastru */
.btn-secondary {
    background-color: #2563eb;
    color: #ffffff;
}

/* Ghost – și el tot albastru + text alb, ca restul butoanelor */
.btn-ghost {
    background-color: #2563eb;
    color: #ffffff;
    border: 1px solid #2563eb;
}

/* Hover */
.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
}

/* Focus */
.btn:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

/* ========== TEXT INFORMATIV / BADGE ========== */

.info-text {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 10px;
}

.badge-role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background-color: #1d4ed8;
    color: #e5e7eb;
    margin-left: 4px;
}

/* ========== TABELE (LISTE MEDICI / FARMACII / VIZITE / RAPOARTE) ========== */

/* wrapper – ca să nu se taie, doar tabelul are scroll în lateral */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

/* Tabel */
table {
    border-collapse: collapse;
    width: 100%;
    min-width: 700px;        /* dacă ecranul e mai mic → scroll în wrapper */
    background-color: #ffffff;
}

table th {
    background-color: #eef2ff;
    font-size: 13px;
    text-align: left;
}

table th,
table td {
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    vertical-align: top;
    font-size: 13px;
}

table tr:nth-child(even) {
    background-color: #f9fafb;
}

/* ========== FORMULARE (LOGIN / ADD / EDIT) ========== */

form {
    display: block;
    width: 100%;
    max-width: 600px;
}

form p {
    margin-bottom: 12px;
}

label {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    font-family: inherit;
}

textarea {
    min-height: 80px;
}

/* ========== RESPONSIVE ========== */

/* Laptop / monitoare mai mici */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Tablete / laptop mic */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    table {
        min-width: 600px;
    }

    table th,
    table td {
        font-size: 12px;
        padding: 6px 6px;
    }
}

/* Telefoane */
@media (max-width: 768px) {
    header h1 {
        font-size: 18px;
    }

    main {
        padding: 12px 10px;
    }

    nav {
        flex-direction: column;
        align-items: flex-start;

        /* pe mobile, header e un pic mai înalt → mutăm nav mai jos */
        top: 64px;
    }

    .nav-left,
    .nav-right {
        width: 100%;
        justify-content: flex-start;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .tile {
        min-height: auto;
    }

    .tile h3 {
        font-size: 15px;
    }

    .tile p {
        font-size: 13px;
    }

    .tile-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    table {
        min-width: 500px;
    }
}

/* Telefoane foarte mici */
@media (max-width: 480px) {
    header h1 {
        font-size: 16px;
    }

    .welcome-card {
        padding: 12px 12px;
    }

    .welcome-card h2 {
        font-size: 18px;
    }

    table {
        min-width: 400px;
    }
}
/* === OVERRIDE GLOBAL BUTOANE: ALBASTRU CU TEXT ALB === */
button,
input[type="submit"],
input[type="button"],
a.btn,
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.pv-btn,
.pv-btn--primary,
.pv-btn--secondary,
.header-logout-link,
.header-dashboard-link {
    background-color: #2563eb !important;  /* albastru */
    color: #ffffff !important;             /* text alb */
    border: 1px solid #2563eb !important;
    border-radius: 999px;
}

/* Hover pentru toate butoanele */
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
a.btn:hover,
.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover,
.pv-btn:hover,
.pv-btn--primary:hover,
.pv-btn--secondary:hover,
.header-logout-link:hover,
.header-dashboard-link:hover {
    background-color: #1d4ed8 !important;  /* albastru mai închis */
    color: #ffffff !important;
}

/* === LAYOUT DASHBOARD PE TELEFON (STIL "BURGER") === */
@media (max-width: 768px) {
    /* Pe ecrane mici, afișăm tile-urile de pe dashboard una sub alta */
    body .dashboard-grid {
        grid-template-columns: 1fr;
    }

    body .dashboard-grid .tile {
        min-height: auto;
    }

    body .dashboard-grid .tile-actions {
        flex-direction: column;
        align-items: stretch;
    }

    body .dashboard-grid .tile-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Telefoane foarte mici – un pic mai mult spațiu la margini */
@media (max-width: 480px) {
    body .page-wrapper {
        padding-left: 8px;
        padding-right: 8px;
    }
}


