/* S.I Tech - Main Stylesheet */
:root {
    --primary: #1565C0;
    --primary-dark: #0D47A1;
    --primary-light: #1976D2;
    --accent: #2196F3;
    --accent-light: #BBDEFB;
    --white: #FFFFFF;
    --off-white: #F5F8FF;
    --gray-light: #E3EAF6;
    --gray: #90A4AE;
    --gray-dark: #546E7A;
    --text: #1A237E;
    --text-body: #37474F;
    --success: #2E7D32;
    --warning: #F57F17;
    --danger: #C62828;
    --shadow: 0 4px 20px rgba(21,101,192,0.12);
    --shadow-hover: 0 8px 32px rgba(21,101,192,0.22);
    --radius: 12px;
    --radius-sm: 6px;
    --transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--off-white);
    color: var(--text-body);
    line-height: 1.6;
    min-height: 100vh;
}

/* Loader */
#page-loader {
    position: fixed; inset: 0;
    background: var(--white);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; transition: opacity 0.5s, visibility 0.5s;
}
#page-loader.hidden { opacity: 0; visibility: hidden; }
.loader-inner {
    display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.loader-logo { font-size: 2rem; font-weight: 800; color: var(--primary); letter-spacing: 2px; }
.spinner {
    width: 48px; height: 48px; border: 4px solid var(--accent-light);
    border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress Bar */
#progress-bar {
    position: fixed; top: 0; left: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 10000; transition: width 0.3s; width: 0%;
}

/* Navbar */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 12px rgba(21,101,192,0.1);
    position: sticky; top: 0; z-index: 100;
}
.navbar-inner {
    max-width: 1200px; margin: 0 auto;
    padding: 0 24px; display: flex; align-items: center;
    justify-content: space-between; height: 70px;
}
.navbar-brand {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none;
}
.navbar-logo {
    height: 44px; width: 44px; object-fit: contain; border-radius: 8px;
}
.navbar-logo-placeholder {
    width: 44px; height: 44px; background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 800; font-size: 1.1rem;
}
.navbar-title { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.navbar-links { display: flex; align-items: center; gap: 8px; }
.navbar-links a {
    text-decoration: none; color: var(--text-body); padding: 8px 16px;
    border-radius: var(--radius-sm); font-weight: 500; transition: var(--transition);
}
.navbar-links a:hover, .navbar-links a.active {
    background: var(--accent-light); color: var(--primary);
}
.btn-nav-cta {
    background: var(--primary) !important; color: white !important;
    padding: 8px 20px !important; border-radius: var(--radius-sm) !important;
}
.btn-nav-cta:hover { background: var(--primary-dark) !important; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--primary); margin: 5px 0; transition: var(--transition); }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent) 100%);
    padding: 100px 24px; text-align: center; color: white; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 20px; line-height: 1.2; }
.hero p { font-size: 1.15rem; opacity: 0.9; margin-bottom: 36px; }
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: var(--radius-sm); font-size: 0.95rem;
    font-weight: 600; text-decoration: none; border: none; cursor: pointer;
    transition: var(--transition); line-height: 1;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline-white { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.7); }
.btn-outline-white:hover { background: white; color: var(--primary); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-sm { padding: 7px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Section */
.section { padding: 80px 24px; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-tag {
    display: inline-block; background: var(--accent-light); color: var(--primary);
    padding: 4px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
}
.section-title { font-size: clamp(1.6rem, 3vw, 2.4rem); color: var(--text); font-weight: 800; margin-bottom: 12px; }
.section-sub { color: var(--gray-dark); font-size: 1.05rem; max-width: 600px; margin: 0 auto; }
.container { max-width: 1200px; margin: 0 auto; }

/* Cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; transition: var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-img { width: 100%; height: 200px; object-fit: cover; background: var(--gray-light); }
.card-img-placeholder {
    width: 100%; height: 200px;
    background: linear-gradient(135deg, var(--accent-light), var(--gray-light));
    display: flex; align-items: center; justify-content: center; font-size: 3rem;
}
.card-body { padding: 24px; }
.card-title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.card-text { color: var(--gray-dark); font-size: 0.9rem; line-height: 1.6; margin-bottom: 16px; }
.card-footer { padding: 16px 24px; background: var(--off-white); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Service Card Price */
.price-block { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.price-original { color: var(--gray); text-decoration: line-through; font-size: 0.85rem; }
.price-final { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.badge-discount {
    background: #FFF3E0; color: #E65100; padding: 2px 8px;
    border-radius: 20px; font-size: 0.75rem; font-weight: 700;
}

/* Badge */
.badge {
    display: inline-flex; align-items: center; padding: 3px 10px;
    border-radius: 20px; font-size: 0.75rem; font-weight: 700;
}
.badge-success { background: #E8F5E9; color: var(--success); }
.badge-warning { background: #FFF8E1; color: var(--warning); }
.badge-danger { background: #FFEBEE; color: var(--danger); }
.badge-info { background: var(--accent-light); color: var(--primary); }
.badge-primary { background: var(--primary); color: white; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; color: var(--text); margin-bottom: 6px; font-size: 0.9rem; }
.form-control {
    width: 100%; padding: 11px 14px; border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm); font-size: 0.95rem; background: white;
    color: var(--text-body); transition: var(--transition); outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,101,192,0.08); }
.form-control::placeholder { color: var(--gray); }
.form-hint { font-size: 0.8rem; color: var(--gray-dark); margin-top: 4px; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 4px; display: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* Auth Pages */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px; background: linear-gradient(135deg, var(--primary-dark), var(--accent));
}
.auth-box {
    background: white; border-radius: var(--radius); padding: 48px 40px;
    width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-title { font-size: 1.6rem; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.auth-sub { color: var(--gray-dark); font-size: 0.9rem; }
.auth-logo-img { height: 60px; object-fit: contain; }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 260px; background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto;
    z-index: 200; transition: var(--transition); display: flex; flex-direction: column;
}
.sidebar-brand {
    padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 12px;
}
.sidebar-brand-text { font-size: 1.2rem; font-weight: 800; color: white; }
.sidebar-nav { flex: 1; padding: 16px 0; }
.sidebar-section { padding: 8px 20px 4px; font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; color: rgba(255,255,255,0.8); text-decoration: none;
    font-size: 0.9rem; font-weight: 500; transition: var(--transition);
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.12); color: white;
}
.sidebar-link.active { border-right: 3px solid white; }
.sidebar-link svg { flex-shrink: 0; }
.admin-main { margin-left: 260px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
    background: white; padding: 0 32px; height: 64px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 8px rgba(21,101,192,0.08); position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.admin-content { padding: 32px; flex: 1; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card {
    background: white; border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 56px; height: 56px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-info .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.stat-info .stat-label { font-size: 0.85rem; color: var(--gray-dark); }

/* Table */
.table-wrap { background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-header { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--gray-light); }
.table-title { font-size: 1rem; font-weight: 700; color: var(--text); }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--off-white); padding: 12px 16px; text-align: left; font-size: 0.8rem; font-weight: 700; color: var(--gray-dark); text-transform: uppercase; letter-spacing: 0.5px; }
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--gray-light); font-size: 0.9rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--off-white); }
.table-img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); background: var(--gray-light); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 24px; opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: white; border-radius: var(--radius); width: 100%; max-width: 560px;
    max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.95); transition: var(--transition);
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { padding: 24px 28px; border-bottom: 1px solid var(--gray-light); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--gray-dark); font-size: 1.4rem; line-height: 1; transition: var(--transition); }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 28px; }
.modal-footer { padding: 16px 28px; border-top: 1px solid var(--gray-light); display: flex; gap: 12px; justify-content: flex-end; }

/* Alert */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
    font-size: 0.9rem; display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: #E8F5E9; color: var(--success); border-left: 4px solid var(--success); }
.alert-danger { background: #FFEBEE; color: var(--danger); border-left: 4px solid var(--danger); }
.alert-warning { background: #FFF8E1; color: var(--warning); border-left: 4px solid var(--warning); }
.alert-info { background: var(--accent-light); color: var(--primary); border-left: 4px solid var(--primary); }

/* Toast */
.toast-container { position: fixed; top: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: white; padding: 14px 20px; border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15); min-width: 280px; max-width: 380px;
    display: flex; align-items: center; gap: 12px; transform: translateX(120%); transition: var(--transition);
    border-left: 4px solid var(--primary);
}
.toast.show { transform: translateX(0); }
.toast.toast-success { border-color: var(--success); }
.toast.toast-danger { border-color: var(--danger); }
.toast-msg { flex: 1; font-size: 0.9rem; color: var(--text-body); }

/* Receipt */
.receipt {
    background: white; border-radius: var(--radius); padding: 40px;
    max-width: 600px; margin: 0 auto; box-shadow: var(--shadow);
}
.receipt-header { text-align: center; border-bottom: 2px solid var(--gray-light); padding-bottom: 24px; margin-bottom: 24px; }
.receipt-logo { height: 60px; margin-bottom: 12px; }
.receipt-title { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.receipt-number { font-size: 0.9rem; color: var(--gray-dark); }
.receipt-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gray-light); }
.receipt-row:last-of-type { border-bottom: none; }
.receipt-label { color: var(--gray-dark); font-size: 0.9rem; }
.receipt-value { font-weight: 600; color: var(--text); font-size: 0.9rem; }
.receipt-total { background: var(--primary); color: white; padding: 16px; border-radius: var(--radius-sm); display: flex; justify-content: space-between; margin-top: 16px; }
.receipt-total .label { font-weight: 600; }
.receipt-total .value { font-size: 1.3rem; font-weight: 800; }
.receipt-footer { text-align: center; margin-top: 24px; color: var(--gray-dark); font-size: 0.85rem; }

/* User Dashboard */
.user-hero {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 48px 24px; color: white;
}
.user-hero h2 { font-size: 1.8rem; font-weight: 800; }
.user-hero p { opacity: 0.85; }

/* Footer */
.footer {
    background: var(--primary-dark); color: rgba(255,255,255,0.8); padding: 56px 24px 24px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; max-width: 1200px; margin: 0 auto 40px; }
.footer-brand { }
.footer-logo-text { font-size: 1.5rem; font-weight: 800; color: white; margin-bottom: 12px; }
.footer-desc { font-size: 0.9rem; line-height: 1.7; }
.footer-heading { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: white; margin-bottom: 16px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; transition: var(--transition); }
.footer-links a:hover { color: white; }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; }

/* Toggle Switch */
.toggle-wrap { display: flex; align-items: center; gap: 12px; }
.toggle {
    position: relative; width: 52px; height: 28px; cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; background: var(--gray);
    border-radius: 28px; transition: var(--transition);
}
.toggle-slider:before {
    content: ''; position: absolute; width: 22px; height: 22px;
    background: white; border-radius: 50%; top: 3px; left: 3px; transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider:before { transform: translateX(24px); }
.toggle-label { font-weight: 600; color: var(--text); }

/* Image Preview */
.img-preview-wrap { position: relative; display: inline-block; margin-top: 8px; }
.img-preview { width: 120px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); border: 2px solid var(--gray-light); }
.img-preview-rm { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; background: var(--danger); color: white; border: none; border-radius: 50%; cursor: pointer; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.page-btn {
    width: 38px; height: 38px; border: 2px solid var(--gray-light);
    background: white; color: var(--text-body); border-radius: var(--radius-sm);
    cursor: pointer; font-size: 0.9rem; transition: var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .navbar-links { display: none; position: absolute; top: 70px; left: 0; right: 0; background: white; flex-direction: column; padding: 12px; box-shadow: var(--shadow); }
    .navbar-links.open { display: flex; }
    .hamburger { display: block; }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .auth-box { padding: 32px 24px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero { padding: 60px 16px; }
    .section { padding: 48px 16px; }
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--gray-light); margin: 24px 0; }
.skeleton {
    background: linear-gradient(90deg, var(--gray-light) 25%, #e9eef8 50%, var(--gray-light) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.spinner-sm {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.4); border-top-color: white;
    border-radius: 50%; animation: spin 0.7s linear infinite;
}
