/* OIS - Global Styles */

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

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-bg: #1e293b;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --sidebar-width: 260px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--light-bg);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-icon:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================
   FORMS
   ============================================ */

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control:disabled {
    background: var(--light-bg);
    color: var(--text-secondary);
    cursor: not-allowed;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-warning {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #78350f;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.info-message {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.info-message p {
    margin: 8px 0;
    color: #1e40af;
}

.info-message strong {
    color: #1e3a8a;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* ============================================
   LOGIN PAGE LAYOUTS
   ============================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.login-header {
    background: var(--dark-bg);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.login-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.login-header p {
    color: #94a3b8;
    font-size: 0.95rem;
}

.login-form {
    padding: 30px;
}

.login-footer {
    background: var(--light-bg);
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ============================================
   ADMIN DASHBOARD LAYOUT
   ============================================ */

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.menu-item.active {
    background: rgba(37, 99, 235, 0.2);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.menu-item .icon {
    margin-right: 12px;
    font-size: 1.2rem;
}

/* Highlighted icons (goldenrod background) */
.menu-item .icon.icon-highlight {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: goldenrod;
    border-radius: 50%;
    font-size: 0.9rem;
}

/* Submenu Styles */
.menu-item.menu-back {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    padding: 10px 20px;
}

.menu-item.menu-back:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item.menu-back .icon {
    font-size: 1rem;
}

.menu-section-header {
    display: flex;
    align-items: center;
    padding: 15px 20px 8px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-section-header .icon {
    margin-right: 10px;
    font-size: 1.3rem;
}

.menu-item.submenu-item {
    padding-left: 25px;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 20px;
}

.menu-section-label {
    padding: 10px 20px 5px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 600;
}

.menu-item.quick-link {
    padding: 8px 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.menu-item.quick-link:hover {
    opacity: 1;
}

.menu-item.quick-link .icon {
    font-size: 1rem;
}

.menu-item.quick-link .icon.icon-highlight {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
}

/* Submenu Arrow Indicator */
.menu-item.has-submenu {
    justify-content: flex-start;
}

.menu-item .submenu-arrow {
    margin-left: auto;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.menu-item:hover .submenu-arrow {
    opacity: 1;
    transform: translateX(3px);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.user-info {
    flex: 1;
}

.user-info strong {
    display: block;
    margin-bottom: 4px;
}

.profile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: goldenrod;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.1rem;
    transition: background 0.2s, transform 0.2s;
    margin-left: 10px;
    color: #1e293b;
}

.profile-icon:hover {
    background: #e6b800;
    transform: scale(1.1);
}

.user-info small {
    color: #94a3b8;
    font-size: 0.85rem;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 0;
    background: var(--light-bg);
}

.content-header {
    background: white;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

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

.welcome-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.dashboard-content {
    padding: 32px;
}

/* ============================================
   STATS & CARDS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    border-radius: 12px;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   TABLES
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    text-align: left;
    padding: 12px;
    background: var(--light-bg);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    overflow-x: auto;
}

/* ============================================
   BADGES & STATUS
   ============================================ */

.badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--light-bg);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #fef3c7;
    color: #78350f;
}

.status-suspended {
    background: #f3f4f6;
    color: #374151;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
}

.action-btn:hover {
    border-color: var(--primary-color);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-btn .icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-muted {
    color: var(--text-secondary);
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

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

@media (max-width: 1200px) {
    .edit-user-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LOGO UPLOAD SECTION
   ============================================ */

.logo-upload-section {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.logo-preview {
    width: 200px;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--light-bg);
    flex-shrink: 0;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.logo-placeholder span {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
}

.logo-placeholder p {
    font-size: 0.9rem;
}

.logo-upload-controls {
    flex: 1;
}

.form-control-file {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-control-file:hover {
    border-color: var(--primary-color);
}

.form-control-file:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ============================================
   ADMIN FORM STYLES
   ============================================ */

.admin-form .card {
    margin-bottom: 24px;
}

.admin-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.required {
    color: var(--danger-color);
}

/* Form control enhancements */
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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

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

/* ============================================
   LIST PAGES
   ============================================ */

.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-toolbar .filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.page-toolbar .filters select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    margin-bottom: 20px;
}

/* Logo in tables */
.table-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--light-bg);
}

.table-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

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

@media (max-width: 768px) {
    .logo-upload-section {
        flex-direction: column;
        align-items: center;
    }
    
    .logo-preview {
        width: 150px;
        height: 150px;
    }
    
    .logo-upload-controls {
        width: 100%;
    }
    
    .page-toolbar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .page-toolbar .filters {
        flex-wrap: wrap;
    }
}
/* ============================================
   DATA TABLES (for list pages)
   ============================================ */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    background: var(--light-bg);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table thead th a {
    color: var(--text-secondary);
    text-decoration: none;
}

.data-table thead th a:hover {
    color: var(--primary-color);
}

.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   FILTER CARDS (for list page filters)
   ============================================ */

.filter-card {
    margin-bottom: 24px;
}

.filter-card .card-body {
    padding: 16px 24px;
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group .form-control {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex-direction: row;
    align-items: center;
}

.filter-actions .btn {
    padding: 8px 16px;
}

/* ============================================
   BADGE COLORS
   ============================================ */

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

/* ============================================
   BUTTON VARIANTS
   ============================================ */

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

.btn-outline:hover {
    background: var(--light-bg);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* ============================================
   EMPTY STATE (small version)
   ============================================ */

.empty-state-small {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
}

.empty-state-small .icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.empty-state-small p {
    margin: 0;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE FILTER ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-actions {
        flex-direction: row;
        justify-content: flex-start;
    }
}
