/**
 * masterplan - Main Stylesheet
 * Modern construction management UI
 */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #3b82f6;
    --sidebar-hover: #334155;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
}

/* Reset */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f1f5f9;
    min-height: 100vh;
    margin: 0;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-item {
    margin: 0.125rem 0.75rem;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav .nav-link i {
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-nav .nav-header {
    color: var(--sidebar-text);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1.5rem 1rem 0.5rem;
    margin: 0 0.75rem;
}

/* Top Navbar */
.navbar {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Auth Layout (Login page) */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo i {
    font-size: 3rem;
    color: var(--primary);
}

.auth-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0.5rem 0 0;
    color: #1e293b;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    background: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
}

/* Stats Cards */
.stat-card {
    padding: 1.5rem;
}

.stat-card .stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1rem;
}

.stat-card .stat-icon.bg-primary { background: var(--primary); }
.stat-card .stat-icon.bg-success { background: var(--success); }
.stat-card .stat-icon.bg-warning { background: var(--warning); }
.stat-card .stat-icon.bg-danger { background: var(--danger); }
.stat-card .stat-icon.bg-info { background: var(--info); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    color: #64748b;
    font-size: 0.875rem;
}

/* Page Header */
.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.25rem;
}

.page-subtitle {
    color: #64748b;
    margin: 0;
}

/* Tables */
.table {
    margin: 0;
}

.table th {
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
    color: #334155;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

.badge.bg-secondary { background-color: #64748b !important; }
.badge.bg-primary { background-color: var(--primary) !important; }
.badge.bg-success { background-color: var(--success) !important; }
.badge.bg-warning { background-color: var(--warning) !important; color: #000; }
.badge.bg-danger { background-color: var(--danger) !important; }
.badge.bg-info { background-color: var(--info) !important; }

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.5rem;
    border-color: #e2e8f0;
    padding: 0.625rem 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.375rem;
}

/* Alerts */
.alert {
    border-radius: 0.5rem;
    border: none;
}

.alert-success { background-color: #d1fae5; color: #065f46; }
.alert-danger { background-color: #fee2e2; color: #991b1b; }
.alert-warning { background-color: #fef3c7; color: #92400e; }
.alert-info { background-color: #e0f2fe; color: #075985; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #94a3b8;
    margin: 0;
}

/* Pagination */
.pagination {
    margin: 0;
}

.pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    color: #64748b;
    border: none;
}

.pagination .page-link:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #e2e8f0;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    padding: 1rem 0.75rem 0.75rem;
    font-size: 0.875rem;
}

/* Action Buttons in Tables */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Wallet Cards */
.wallet-card {
    padding: 1.5rem;
    border-radius: 1rem;
    color: #fff;
}

.wallet-card.service {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.wallet-card.payments {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.wallet-card .wallet-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.wallet-card .wallet-balance {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Custom checkbox/radio for selection */
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Modal improvements */
.modal-header {
    border-bottom-color: #e2e8f0;
}

.modal-footer {
    border-top-color: #e2e8f0;
}

/* Print styles */
@media print {
    .sidebar, .navbar, .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

