@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');

/* ═══════════════════════════════════════════════════════
   GETSERVICES — GLOBAL DESIGN SYSTEM
   Version: 3.0 | Full Vanilla CSS
   ═══════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties (Design Tokens) ─── */
:root {
    /* Colors */
    --primary:          #f10505;
    --primary-hover:    #d10404;
    --primary-light:    #fff1f1;
    --text:             #111111;
    --text-muted:       #666666;
    --text-light:       #999999;
    --text-white:       #ffffff;
    --bg:               #ffffff;
    --surface:          #f9f9f9;
    --surface-alt:      #f2f2f2;
    --border:           #e5e5e5;
    --badge-bg:         #fff1f1;

    /* Radii */
    --radius-xs:        4px;
    --radius-sm:        8px;
    --radius-md:        12px;
    --radius-lg:        16px;
    --radius-xl:        24px;

    /* Shadows */
    --shadow-xs:        0 1px 2px rgba(0,0,0,0.06);
    --shadow-sm:        0 1px 4px rgba(0,0,0,0.08);
    --shadow:           0 2px 8px rgba(0,0,0,0.10);
    --shadow-md:        0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg:        0 8px 32px rgba(0,0,0,0.16);

    /* Transitions */
    --transition:       all 0.2s ease;
    --transition-slow:  all 0.35s ease;
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── Base ─── */
html { scroll-behavior: smooth; }

body {
    font-family: 'Figtree', sans-serif;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1 0 auto; }

/* ─── Typography ─── */
h1, h2, h3, h4 { color: var(--text); line-height: 1.25; }
h1 { font-weight: 900; }
h2 { font-weight: 800; }
h3 { font-weight: 800; }
h4 { font-weight: 700; }
h5, h6 { font-weight: 700; color: var(--text); }

.title-900 { font-weight: 900; }
.title-800 { font-weight: 800; }
.title-700 { font-weight: 700; }

p { color: var(--text-muted); line-height: 1.7; }

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

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: 'Figtree', sans-serif;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary  { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(241,5,5,0.3); }

.btn-outline  { border: 1px solid var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-ghost    { color: var(--text-muted); background: transparent; }
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-danger   { background: #dc3545; color: white; }
.btn-danger:hover { background: #c82333; }

.btn-success  { background: #22c55e; color: white; }
.btn-success:hover { background: #16a34a; }

.btn-whatsapp { background: #25D366; color: white; }
.btn-whatsapp:hover { background: #128C7E; }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }

/* ═══════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════ */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Figtree', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: white;
    outline: none;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(241,5,5,0.08);
}
.form-control::placeholder { color: var(--text-light); }

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

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23999' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-error { color: var(--primary); font-size: 12px; margin-top: 6px; font-weight: 700; }
.form-hint  { color: var(--text-light); font-size: 12px; margin-top: 6px; }

/* ═══════════════════════════════════════════
   BADGES & STATUS
   ═══════════════════════════════════════════ */
.badge        { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: var(--surface-alt); color: var(--text-muted); }

.status-badge     { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; }
.status-open      { background: #fef9c3; color: #854d0e; }
.status-progress  { background: #dbeafe; color: #1e40af; }
.status-completed { background: #dcfce7; color: #166534; }
.status-cancelled { background: var(--surface-alt); color: var(--text-muted); }
.status-pending   { background: #fef9c3; color: #854d0e; }
.status-approved  { background: #dcfce7; color: #166534; }
.status-rejected  { background: #fee2e2; color: #991b1b; }

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-large   { border-radius: var(--radius-lg); padding: 32px; }
.card-surface { background: var(--surface); border: none; }

/* ═══════════════════════════════════════════
   LAYOUT PRIMITIVES
   ═══════════════════════════════════════════ */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Navbar */
.navbar {
    height: 80px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Footer */
.footer { background: #111; color: white; padding: 64px 0 24px; margin-top: auto; }

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-md); }
.table { width: 100%; border-collapse: collapse; min-width: 580px; }
.table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-light);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface); }

/* ═══════════════════════════════════════════
   SKELETON LOADING
   ═══════════════════════════════════════════ */
.skeleton { background: var(--surface-alt); animation: pulse 1.5s infinite ease-in-out; border-radius: var(--radius-xs); }
@keyframes pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* ═══════════════════════════════════════════
   FLEX UTILITIES
   ═══════════════════════════════════════════ */
.flex          { display: flex; }
.flex-column   { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.flex-mobile-stack { flex-wrap: wrap; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }

/* ═══════════════════════════════════════════
   GRID UTILITIES
   ═══════════════════════════════════════════ */
.grid { display: grid; }
.md-grid-2 { grid-template-columns: repeat(2, 1fr); }
.md-grid-3 { grid-template-columns: repeat(3, 1fr); }
.md-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ═══════════════════════════════════════════
   GAP UTILITIES
   ═══════════════════════════════════════════ */
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-40 { gap: 40px; }
.gap-48 { gap: 48px; }

/* ═══════════════════════════════════════════
   PADDING UTILITIES
   ═══════════════════════════════════════════ */
.padding-8  { padding: 8px; }
.padding-16 { padding: 16px; }
.padding-24 { padding: 24px; }
.padding-32 { padding: 32px; }
.padding-40 { padding: 40px; }

/* ═══════════════════════════════════════════
   TEXT UTILITIES
   ═══════════════════════════════════════════ */
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-left     { text-align: left; }
.text-primary  { color: var(--primary) !important; }
.text-muted    { color: var(--text-muted); }
.text-light    { color: var(--text-light); }
.text-white    { color: white; }
.text-success  { color: #166534; }
.text-danger   { color: #991b1b; }

/* ═══════════════════════════════════════════
   BACKGROUND UTILITIES
   ═══════════════════════════════════════════ */
.bg-primary  { background: var(--primary); }
.bg-surface  { background: var(--surface); }
.bg-white    { background: white; }

/* ═══════════════════════════════════════════
   SIZE UTILITIES
   ═══════════════════════════════════════════ */
.w-full { width: 100%; }
.h-full { height: 100%; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
.fade-in { animation: fadeIn 0.4s ease-in-out both; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.slide-up { animation: slideUp 0.4s ease both; }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   GLOBAL LOADER
   ═══════════════════════════════════════════ */
#global-loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}
.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--surface-alt);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-weight: 700;
    font-size: 14px;
    pointer-events: all;
    max-width: 360px;
    min-width: 240px;
    animation: toastIn 0.3s ease both;
}
.toast-success { background: #1a7a3c; color: white; }
.toast-error   { background: #dc3545; color: white; }
.toast-warning { background: #c9820e; color: white; }
.toast-info    { background: #0d6efd; color: white; }
.toast-item .toast-icon  { font-size: 16px; flex-shrink: 0; }
.toast-item .toast-close { margin-left: auto; cursor: pointer; opacity: 0.8; background: none; border: none; color: inherit; font-size: 18px; padding: 0; line-height: 1; }
.toast-item.toast-hiding { animation: toastOut 0.3s ease both; }
@keyframes toastIn  { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to   { transform: translateX(110%); opacity: 0; } }

/* ═══════════════════════════════════════════
   CONFIRM MODAL
   ═══════════════════════════════════════════ */
#gs-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 8500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
#gs-confirm-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.2s ease;
}
#gs-confirm-box .confirm-icon { font-size: 40px; margin-bottom: 16px; }
#gs-confirm-box h4 { margin-bottom: 10px; font-size: 18px; }
#gs-confirm-box p  { color: var(--text-muted); margin-bottom: 28px; line-height: 1.6; font-size: 15px; }
#gs-confirm-box .btn-row { display: flex; gap: 12px; justify-content: flex-end; }

/* ═══════════════════════════════════════════
   GENERIC MODAL
   ═══════════════════════════════════════════ */
.gs-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 5000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px 24px;
    overflow-y: auto;
}
.gs-modal-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.25s ease;
    position: relative;
    margin: auto;
}
.gs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}
.gs-modal-header h3  { font-size: 20px; margin: 0; }
.gs-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-light);
    padding: 4px 8px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.gs-modal-close:hover { background: var(--surface); color: var(--text); }

/* ═══════════════════════════════════════════
   MOBILE SIDEBAR CONTROLS
   ═══════════════════════════════════════════ */
.mobile-toggle {
    display: none;
    cursor: pointer;
    padding: 8px;
    font-size: 22px;
    color: var(--text);
    background: transparent;
    border: none;
    line-height: 1;
}
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    display: none;
    cursor: pointer;
}
.sidebar-overlay.active { display: block; }

/* ═══════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════ */

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {
    .container { padding: 0 16px; }
    .md-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .md-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
    /* Grid collapses to single column */
    .grid,
    .md-grid-2,
    .md-grid-3,
    .md-grid-4 { grid-template-columns: 1fr !important; }

    /* Flex stacks vertically */
    .flex-column-mobile { flex-direction: column !important; }
    .flex-mobile-stack  { flex-direction: column !important; }

    /* Text */
    .text-center-mobile   { text-align: center !important; }
    .justify-center-mobile { justify-content: center !important; }

    /* Visibility */
    .hidden-mobile  { display: none !important; }
    .w-full-mobile  { width: 100% !important; }

    /* Gap helpers mobile */
    .gap-mobile-8  { gap: 8px !important; }
    .gap-mobile-16 { gap: 16px !important; }

    /* Sidebars — slide off screen */
    .sidebar, .admin-sidebar, .client-sidebar, .pro-sidebar {
        transform: translateX(-100%);
        position: fixed !important;
        z-index: 2050 !important;
        top: 0 !important;
        left: 0;
        width: 280px;
        height: 100vh;
        overflow-y: auto;
        transition: transform 0.3s ease;
    }
    .sidebar.open,
    .admin-sidebar.open,
    .client-sidebar.open,
    .pro-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }

    /* Dashboard mains */
    .main-content, .admin-main, .client-main, .pro-main {
        margin-left: 0 !important;
        padding: 24px 16px !important;
        margin-top: 80px !important;
    }

    /* Mobile toggle becomes visible */
    .mobile-toggle { display: block !important; }

    /* Hero */
    .hero { height: auto !important; min-height: 420px !important; }
    .hero h1 { font-size: 30px !important; }

    /* Navbar */
    .navbar { padding: 0 16px; }

    /* Modal */
    .gs-modal { padding: 16px; align-items: flex-start; }
    .gs-modal-box { padding: 24px; margin-top: 16px; }
    #gs-confirm-box { padding: 24px; }

    /* Cards */
    .card-large { padding: 20px; }

    /* Footer */
    footer .grid { gap: 28px !important; }
}

/* ── Small Mobile (≤480px) ── */
@media (max-width: 480px) {
    h1 { font-size: 24px !important; }
    h2 { font-size: 20px !important; }
    .btn { padding: 10px 16px; font-size: 14px; }
    .btn-lg { padding: 12px 20px; font-size: 15px; }
    #toast-container { right: 12px; bottom: 12px; left: 12px; }
    .toast-item { max-width: 100%; min-width: unset; }
    .form-control { font-size: 16px; } /* Prevent iOS zoom */
    .padding-40 { padding: 24px !important; }
    .padding-32 { padding: 20px !important; }
}
