/* ============================================
   SiteOne Telecom - Global Styles
   Colors: Blue #0063A0, Dark Gray #4D4D4D
   ============================================ */

:root {
    --primary: #0063A0;
    --primary-dark: #004A78;
    --primary-light: #E5F0F8;
    --primary-50: #F0F7FC;
    --primary-100: #CCE3F3;
    --primary-200: #99C7E7;
    --primary-300: #66ABDB;
    --primary-400: #338FCF;
    --primary-500: #0073B8;
    --primary-600: #0063A0;
    --primary-700: #004A78;
    --primary-800: #003150;
    --primary-900: #001928;

    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    --secondary: #4D4D4D;
    --accent: #2B5797;
    --danger: #DC3545;
    --success: #28A745;
    --warning: #FFC107;
    --info: #17A2B8;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: 16px;
    color: var(--gray-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--primary-dark);
}

/* ============================================
   Mobile App Container
   ============================================ */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    position: relative;
}

@media (min-width: 769px) {
    body {
        background: var(--gray-100);
    }
    .app-container {
        box-shadow: var(--shadow-lg);
        border-left: 1px solid var(--gray-200);
        border-right: 1px solid var(--gray-200);
    }
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #fff;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    width: 180px;
    height: auto;
    margin-bottom: 8px;
}

.login-logo p {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.login-form-container {
    background: #fff;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-family);
    color: var(--gray-800);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    background: #fff;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 99, 160, 0.3);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-error {
    font-size: 13px;
    color: var(--danger);
    background: #FEF2F2;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.forgot-link {
    display: block;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}
.btn-secondary:hover {
    background: var(--gray-200);
}

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

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover {
    background: #218838;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-compact {
    max-width: 25%;
    font-size: 12px;
    padding: 10px 0;
    white-space: nowrap;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.login-footer {
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 16px;
}

.login-footer a {
    font-weight: 500;
    color: var(--primary);
}

/* ============================================
   Top Header / App Bar
   ============================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.app-header-logo {
    height: 32px;
    width: auto;
}

.app-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    flex: 1;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s;
}
.header-icon-btn:hover {
    background: var(--gray-100);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + var(--safe-bottom));
    z-index: 50;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 4px;
    color: var(--gray-400);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.bottom-nav-item i {
    font-size: 18px;
}

.bottom-nav-item span {
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item:hover {
    color: var(--primary);
}

/* ============================================
   Content Area
   ============================================ */
.app-content {
    padding: 16px;
    padding-bottom: 80px;
    min-height: calc(100vh - 60px);
}

/* ============================================
   Section Title
   ============================================ */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 16px;
}

/* ============================================
   Category Cards (Main Grid - 2 options)
   ============================================ */
.main-category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.main-category-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: #fff;
    display: block;
    min-height: 140px;
}

.main-category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: #fff;
}

.main-category-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.main-category-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,99,160,0.9), rgba(0,74,120,0.85));
}

.main-category-card.infra .main-category-card-overlay {
    background: linear-gradient(135deg, rgba(77,77,77,0.9), rgba(55,65,81,0.85));
}

.main-category-card.software .main-category-card-overlay {
    background: linear-gradient(135deg, rgba(124,77,255,0.9), rgba(98,0,234,0.85));
}

.main-category-card-content {
    position: relative;
    z-index: 1;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.main-category-icon {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.main-category-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.main-category-info p {
    font-size: 13px;
    opacity: 0.9;
}

/* ============================================
   Service Grid (Sub-categories)
   ============================================ */
.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.service-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--gray-800);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.service-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
    color: var(--gray-800);
}

.service-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.service-card h4 {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.service-card p {
    font-size: 11px;
    color: var(--gray-500);
}

/* ============================================
   Service List
   ============================================ */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-list-item {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--gray-800);
}

.service-list-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    color: var(--gray-800);
}

.service-list-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.service-list-info {
    flex: 1;
    min-width: 0;
}

.service-list-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.service-list-info p {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-list-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.service-list-arrow {
    color: var(--gray-400);
    font-size: 14px;
}

/* ============================================
   Request Form / Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-sheet {
    background: #fff;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    margin: 0 auto 16px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-family);
    color: var(--gray-800);
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 99, 160, 0.3);
}

/* ============================================
   Status Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pending { background: #FFF3CD; color: #856404; }
.badge-quoted { background: #D1ECF1; color: #0C5460; }
.badge-approved { background: #D4EDDA; color: #155724; }
.badge-progress { background: #CCE5FF; color: #004085; }
.badge-completed { background: #D4EDDA; color: #155724; }
.badge-cancelled { background: #F8D7DA; color: #721C24; }

/* ============================================
   Cards
   ============================================ */
.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
}

/* ============================================
   Stats Grid (Admin/Employee)
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

/* ============================================
   Table (Admin)
   ============================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: var(--gray-50);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: var(--gray-50);
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab:hover {
    color: var(--primary);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 13px;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: 100%;
    max-width: 440px;
    padding: 0 16px;
    pointer-events: none;
}

.toast {
    background: var(--gray-800);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 8px;
    animation: toastIn 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--gray-800); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Utilities
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-gray { color: var(--gray-500); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.hidden { display: none !important; }

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
