/* ===================================
   TENDER MANAGEMENT SYSTEM
   Perfect Facilities Management
   =================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2a9d8f;
    --primary-dark: #238276;
    --navy: #1d4e89;
    --navy-dark: #153a65;
    --charcoal: #2b2d42;
    --grey-50: #f8f9fa;
    --grey-100: #e9ecef;
    --grey-200: #dee2e6;
    --grey-600: #6c757d;
    --white: #ffffff;
    --error: #dc2626;
    --success: #16a34a;

    --shadow-sm: 0 1px 2px 0 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--grey-50);
    color: var(--charcoal);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   MAIN LOGIN CONTAINER
   =================================== */
.login-container {
    display: grid;
    grid-template-columns: 480px 1fr;
    min-height: 100vh;
}

/* ===================================
   LEFT PANEL - BRANDING
   =================================== */
.left-panel {
    background: linear-gradient(135deg, var(--navy) 0%, var(--primary) 100%);
    color: var(--white);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.05); }
}

.brand-section {
    position: relative;
    z-index: 1;
}

.company-logo {
    margin-bottom: 1.5rem;
}

.company-name {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.system-name {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Info Section - Stats */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 3rem 0;
    position: relative;
    z-index: 1;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.stat-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Features List */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
}

.feature-item svg {
    flex-shrink: 0;
    opacity: 0.9;
}

/* Footer Info */
.footer-info {
    font-size: 0.875rem;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

.footer-info p {
    margin-bottom: 0.5rem;
}

.footer-info a {
    color: var(--white);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    transition: var(--transition);
}

.footer-info a:hover {
    border-bottom-color: var(--white);
}

/* ===================================
   RIGHT PANEL - LOGIN FORM
   =================================== */
.right-panel {
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    overflow-y: auto;
    flex-direction: column;
}

.login-box {
    width: 100%;
    max-width: 440px;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 1rem;
    color: var(--grey-600);
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--charcoal);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--grey-600);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--grey-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--charcoal);
    transition: var(--transition);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--grey-600);
    opacity: 0.7;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--grey-600);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

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

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -0.5rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--charcoal);
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-full {
    width: 100%;
}

.btn-sso {
    width: 100%;
    background: var(--white);
    color: var(--charcoal);
    border-color: var(--grey-200);
    justify-content: flex-start;
}

.btn-sso:hover {
    background: var(--grey-50);
    border-color: var(--primary);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--grey-200);
}

.divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--grey-600);
}

/* SSO Buttons */
.sso-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Help Section */
.help-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--grey-200);
    text-align: center;
}

.help-section p {
    font-size: 0.875rem;
    color: var(--grey-600);
    margin-bottom: 0.5rem;
}

.support-link {
    font-size: 0.9375rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.support-link:hover {
    text-decoration: underline;
}

/* Quick Links Section (shown after login) */
.quick-links {
    margin-top: 3rem;
    width: 100%;
    max-width: 440px;
}

.quick-links h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 1rem;
}

.links-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.quick-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--white);
    border: 2px solid var(--grey-200);
    border-radius: 12px;
    text-decoration: none;
    color: var(--charcoal);
    transition: var(--transition);
}

.quick-link-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.link-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.link-content {
    flex: 1;
}

.link-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.25rem;
}

.link-content p {
    font-size: 0.875rem;
    color: var(--grey-600);
}

.link-arrow {
    color: var(--grey-600);
    flex-shrink: 0;
    transition: var(--transition);
}

.quick-link-card:hover .link-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.notification-error {
    background: #fee2e2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.notification-success {
    background: #dcfce7;
    color: #16a34a;
    border-left: 4px solid #16a34a;
}

.notification-info {
    background: #dbeafe;
    color: #1d4ed8;
    border-left: 4px solid #1d4ed8;
}

.notification-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Spinner */
.spinner {
    animation: spin 1s linear infinite;
}

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

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
    }

    .left-panel {
        min-height: auto;
        padding: 2rem;
    }

    .info-section {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.75rem;
    }

    .stat-card {
        min-width: 180px;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .right-panel {
        padding: 2rem 1.5rem;
    }

    .login-header h2 {
        font-size: 1.75rem;
    }

    .company-name {
        font-size: 1.75rem;
    }

    .info-section {
        flex-direction: column;
    }

    .stat-card {
        min-width: auto;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }

    .notification {
        left: 1rem;
        right: 1rem;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .left-panel {
        padding: 1.5rem;
    }

    .right-panel {
        padding: 1.5rem 1rem;
    }

    .company-name {
        font-size: 1.5rem;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }
}
/* --- DASHBOARD LAYOUT (template-dashboard.php) --- */

body.saas-dashboard-body {
    background-color: #f1f5f9; /* Slate 100 */
    margin: 0;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* Prevent body scroll, layout scrolls internally */
}

/* HEADER */
.saas-header {
    background-color: #1e293b; /* Slate 800 */
    color: #fff;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
    z-index: 10;
}

.logo-text { font-weight: 700; font-size: 1.1rem; margin-left: 0.5rem; }
.user-profile { font-size: 0.9rem; }
.btn-logout { 
    margin-left: 1rem; 
    color: #94a3b8; 
    text-decoration: none; 
    font-size: 0.8rem; 
    border: 1px solid #334155;
    padding: 4px 10px;
    border-radius: 4px;
}
.btn-logout:hover { color: #fff; border-color: #fff; }

/* LAYOUT CONTAINER */
.saas-layout {
    display: flex;
    flex: 1;
    overflow: hidden; /* Container defines scroll area */
}

/* SIDEBAR */
.saas-sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    padding: 1.5rem;
    overflow-y: auto;
    flex-shrink: 0;
    display: none; /* Mobile first hidden */
}
@media(min-width: 1024px) { .saas-sidebar { display: block; } }

.sidebar-header h3 { margin: 0 0 1.5rem 0; font-size: 1rem; color: #0f172a; }

.filter-group { margin-bottom: 1.25rem; }
.filter-group label { display: block; font-size: 0.8rem; font-weight: 600; color: #64748b; margin-bottom: 0.4rem; }
.form-control {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
}
.checkbox-list label { display: block; font-size: 0.9rem; margin-bottom: 0.3rem; color: #334155; }
.btn-apply {
    width: 100%;
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
}
.btn-apply:hover { background: #059669; }

/* MAIN CONTENT */
.saas-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto; /* Main scrollbar */
}

/* KPI CARDS */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.kpi-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kpi-label { font-size: 0.85rem; color: #64748b; font-weight: 500; }
.kpi-value { font-size: 1.8rem; font-weight: 700; color: #0f172a; margin-top: 0.5rem; }
.text-green { color: #10b981; }
.text-red { color: #ef4444; }

/* CONTENT HEADER */
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.content-header h2 { margin: 0; font-size: 1.5rem; color: #1e293b; }
.btn-secondary {
    background: #fff; border: 1px solid #cbd5e1; padding: 0.5rem 1rem; border-radius: 6px; color: #475569; cursor: pointer;
}
/* --- SAAS DATA TABLE STYLES --- */

.saas-table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden; /* For rounded corners */
    border: 1px solid #e2e8f0;
}

.saas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: #334155;
}

.saas-table thead {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.saas-table th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.saas-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.saas-table tr:last-child td { border-bottom: none; }
.saas-table tr:hover { background-color: #f8fafc; }

/* Columns specific */
.col-title strong { color: #0f172a; display: block; margin-bottom: 2px; }
.btn-view {
    display: inline-block;
    padding: 6px 12px;
    background-color: #eff6ff;
    color: #2563eb;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.btn-view:hover { background-color: #2563eb; color: #fff; }

.empty-state {
    padding: 3rem;
    text-align: center;
    color: #64748b;
    background: #fff;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}