/* styles.css — HRM Mobile-First Responsive */

:root {
    --primary: #1a73e8;
    --primary-light: #e8f0fe;
    --primary-dark: #1557b0;
    --green: #34a853;
    --green-light: #e6f4ea;
    --yellow: #fbbc05;
    --yellow-light: #fef7e0;
    --red: #ea4335;
    --red-light: #fce8e6;
    --dark: #1a1a2e;
    --text: #3c4043;
    --text-muted: #6b7280;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --bottom-bar-h: 60px;
    --header-h: 56px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
    font-weight: 600;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }

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

/* ===========================
   HEADER
   =========================== */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-h);
}

.nav-container {
    display: flex;
    align-items: center;
    padding: 0 12px;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    gap: 8px;
    flex-shrink: 0;
}

.logo i { font-size: 1.2rem; }

/* Hamburger — ascuns pe desktop, ASCUNS și pe mobil (nu-l mai folosim) */
.hamburger {
    display: none !important;
}

/* Nav menu — desktop */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin-left: auto;
}

.nav-link {
    color: var(--text);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-link:hover { background: var(--gray-100); color: var(--primary); }
.nav-link.active { color: var(--primary); background: var(--primary-light); }
.nav-link i { font-size: 0.85rem; }

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-info {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.logout-btn {
    background: var(--gray-100);
    color: var(--text);
    border: 1px solid var(--gray-300);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.logout-btn:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

/* Nav overlay */
.nav-overlay {
    display: none;
}

/* ===========================
   MAIN CONTENT
   =========================== */
.main-content { padding: 16px 0; }

/* ===========================
   CARDS
   =========================== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

/* ===========================
   GRID
   =========================== */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===========================
   STATS CARDS
   =========================== */
.stats-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border-top: 3px solid var(--primary);
}
.stats-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stats-card i { font-size: 1.8rem; margin-bottom: 8px; color: var(--primary); }
.stats-value { font-size: 1.75rem; font-weight: 700; color: var(--dark); }
.stats-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.stats-primary { border-top-color: var(--primary); }
.stats-primary i { color: var(--primary); }
.stats-success { border-top-color: var(--green); }
.stats-success i { color: var(--green); }
.stats-warning { border-top-color: var(--yellow); }
.stats-warning i { color: var(--yellow); }
.stats-danger { border-top-color: var(--red); }
.stats-danger i { color: var(--red); }

/* ===========================
   BUTTONS
   =========================== */
.btn {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    min-height: 40px;
    touch-action: manipulation;
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; min-height: 34px; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--green); color: var(--white); }
.btn-success:hover { background: #2e7d32; }
.btn-warning { background: var(--yellow); color: var(--white); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #c62828; }
.btn-outline { background: transparent; border: 1px solid var(--gray-300); color: var(--text); }
.btn-outline:hover { background: var(--gray-100); border-color: var(--gray-400); }
.btn-link { background: none; color: var(--primary); padding: 0; font-weight: 500; }
.btn-block { width: 100%; }
.btn-icon { gap: 8px; }

/* ===========================
   FORMS
   =========================== */
.form-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--white);
    color: var(--text);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ===========================
   TABLES — desktop
   =========================== */
.table-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
}
.table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--dark);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.table tbody tr:hover { background: var(--primary-light); }
.table .actions { white-space: nowrap; }

/* Mobile card-table — ascuns pe desktop */
.mobile-cards { display: none; }

/* ===========================
   BADGES
   =========================== */
.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--green-light); color: var(--green); }
.badge-warning { background: var(--yellow-light); color: #d93025; }
.badge-danger { background: var(--red-light); color: var(--red); }
.badge-pending { background: var(--yellow-light); color: #f57c00; }
.badge-approved { background: var(--green-light); color: var(--green); }
.badge-rejected { background: var(--red-light); color: var(--red); }
.badge-manager { background: var(--primary-light); color: var(--primary); }
.badge-efectuat { background: #e8eaf6; color: #3f51b5; }
.badge-aprobat { background: #e3f2fd; color: #1976d2; }
.badge-secondary { background: var(--gray-200); color: var(--text); }

.badge-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.badge-action-edit { background: var(--primary); color: var(--white); }
.badge-action-edit:hover { background: var(--primary-dark); color: var(--white); text-decoration: none; }
.badge-action-delete { background: var(--red); color: var(--white); }
.badge-action-delete:hover { background: #c62828; color: var(--white); text-decoration: none; }

.table .actions .badge-action { flex-shrink: 0; }
.table .actions form { display: inline; margin: 0; padding: 0; border: none; background: none; }

/* ===========================
   FLASH MESSAGES
   =========================== */
.flash-messages { margin-bottom: 16px; }
.flash-message {
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.4s;
}
.alert-success { background: var(--green-light); color: #1b5e20; border-left: 3px solid var(--green); }
.alert-danger { background: var(--red-light); color: #b71c1c; border-left: 3px solid var(--red); }
.alert-warning { background: var(--yellow-light); color: #e65100; border-left: 3px solid var(--yellow); }
.alert-info { background: var(--primary-light); color: var(--primary); border-left: 3px solid var(--primary); }

/* ===========================
   LOGIN
   =========================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 16px;
}
.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    width: 100%;
    max-width: 400px;
}
.login-header {
    text-align: center;
    margin-bottom: 20px;
}
.login-header h1 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 4px;
}
.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===========================
   ERROR
   =========================== */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.error-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    text-align: center;
    max-width: 400px;
}
.error-card h1 { color: var(--red); margin-bottom: 12px; }

/* ===========================
   PAGINATION
   =========================== */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 16px 0;
    gap: 4px;
}
.pagination-link {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    color: var(--text);
    background: var(--white);
    font-size: 0.85rem;
}
.pagination-link:hover { border-color: var(--primary); color: var(--primary); }
.pagination-link.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ===========================
   CALENDAR
   =========================== */
.calendar-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

/* ===========================
   EMPTY STATE
   =========================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; color: var(--gray-300); margin-bottom: 12px; display: block; }

/* ===========================
   FOOTER
   =========================== */
.footer {
    background: var(--white);
    padding: 16px 0;
    text-align: center;
    border-top: 1px solid var(--gray-200);
}
.footer p { color: var(--text-muted); font-size: 0.8rem; }

/* ===========================
   BOTTOM TAB BAR — mobil (2 rânduri, ascuns pe desktop)
   =========================== */
.bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 500;
    padding: 6px 0;
    transition: color 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bottom-tab i { font-size: 1rem; }
.bottom-tab.active { color: var(--primary); }

.bottom-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.bottom-row-2 {
    grid-template-columns: repeat(6, 1fr);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-100);
}
.bottom-logout-form {
    display: contents;
}
.bottom-logout-form .bottom-tab {
    width: 100%;
    color: var(--red);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.bottom-logout-form .bottom-tab i { font-size: 1.1rem; }

/* ===========================
   DASHBOARD HEADER
   =========================== */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dashboard-title { margin: 0; }
.welcome-message {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===========================
   UTILITIES
   =========================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.ml-1 { margin-left: 0.5rem; }
.ml-2 { margin-left: 1rem; }
.mr-1 { margin-right: 0.5rem; }
.p-0 { padding: 0; }
.w-100 { width: 100%; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { justify-content: center; }
.align-center { align-items: center; }

/* ===========================
   RESPONSIVE — TABLET (<= 992px)
   =========================== */
@media (max-width: 992px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ===========================
   RESPONSIVE — MOBIL (<= 768px)
   =========================== */
@media (max-width: 768px) {
    :root {
        --header-h: 44px;
    }

    .container { padding: 12px; }

    /* Header — doar logo, nimic altceva */
    .nav-container {
        padding: 0 12px;
    }

    .logo {
        font-size: 1.05rem;
        gap: 6px;
    }
    .logo i { font-size: 1.1rem; }

    /* Ascunde complet nav desktop și user menu pe mobil */
    .nav-menu { display: none !important; }
    .user-menu { display: none !important; }
    .hamburger { display: none !important; }
    .nav-overlay { display: none !important; }

    /* Grid */
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    /* Dashboard header */
    .dashboard-header {
        justify-content: space-between;
    }
    .dashboard-title { font-size: 1.25rem; }
    .welcome-message { font-size: 0.9rem; }

    /* Card header stacking */
    .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* Form actions full width */
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }

    /* Table: ascunde pe mobil, arată card-urile */
    .table-container { display: none; }
    .mobile-cards { display: block; }

    /* Mobile card styles */
    .mobile-card {
        background: var(--white);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 14px;
        margin-bottom: 10px;
    }
    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 8px;
    }
    .mobile-card-name {
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--dark);
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .mobile-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        font-size: 0.85rem;
        border-bottom: 1px solid var(--gray-100);
    }
    .mobile-card-row:last-child { border-bottom: none; }
    .mobile-card-label { color: var(--text-muted); }
    .mobile-card-value { font-weight: 500; }
    .mobile-card-actions {
        display: flex;
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--gray-200);
    }
    .mobile-card-actions .btn { flex: 1; min-height: 36px; font-size: 0.8rem; }
    .mobile-card-actions .badge-action { flex: 1; justify-content: center; min-height: 36px; }
    .mobile-card-actions form { flex: 1; display: flex; }
    .mobile-card-actions form .badge-action { width: 100%; }

    /* Bottom bar — 2 rânduri */
    .bottom-bar { display: block; }
    .main-content { padding-bottom: 120px; }

    /* Footer hidden pe mobil */
    .footer { display: none; }

    /* Login */
    .login-container { min-height: 50vh; }
    .login-card { padding: 20px; }
}

/* ===========================
   RESPONSIVE — MIC (<= 480px)
   =========================== */
@media (max-width: 480px) {
    .stats-card { padding: 12px; }
    .stats-value { font-size: 1.4rem; }
    .stats-card i { font-size: 1.4rem; }

    .card { padding: 12px; }

    .btn { min-height: 44px; font-size: 0.9rem; }

    .form-control { padding: 12px; font-size: 1rem; }

    .mobile-card-header { flex-direction: column; gap: 4px; }

    .mobile-card-actions { flex-direction: column; }
}

/* ===========================
   CARD LINK (navigare brand/magazin)
   =========================== */
.card-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stats-row {
    display: flex;
    justify-content: space-around;
    text-align: center;
}
.stats-item { display: flex; flex-direction: column; }
.stats-item .stats-value { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.stats-item .stats-label { font-size: 0.8rem; color: var(--text-muted); }

.fc .fc-toolbar-title { font-size: 1.1rem; }

/* Tooltip motiv respingere */
.tooltip {
    position: relative;
    cursor: help;
}
.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: normal;
    max-width: 250px;
    word-wrap: break-word;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    pointer-events: none;
    text-align: center;
    line-height: 1.3;
}
.tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    pointer-events: none;
}
.tooltip:hover::after,
.tooltip:hover::before,
.tooltip.tap::after,
.tooltip.tap::before {
    opacity: 1;
    visibility: visible;
}
.tooltip:not([data-tooltip])::after,
.tooltip[data-tooltip=""]::after {
    display: none;
}
