/* 
 * LoanBazzar Unified Admin Stylesheet
 * Version: 2.0
 * This file standardizes styling across all admin pages
 */

:root {
    /* Royal Blue & Gold Theme */
    --primary-blue: #1E3A8A; /* Royal Blue - Trust, stability */
    --secondary-blue: #2D4EA0; /* Slightly lighter royal blue */
    --accent-gold: #D4AF37; /* Gold - Prestige, prosperity */
    --dark-gold: #BF9B30; /* Darker gold */
    --dark-grey: #1A202C;
    --grey: #718096;
    --light-grey: #F3F4F6; /* Light Gray - Neutral balance */
    --white: #FFFFFF; /* White - Clean, professional */
    
    /* Typography */
    --heading-font: 'Poppins', sans-serif;
    --body-font: 'Open Sans', sans-serif;
    
    /* Admin Panel Colors */
    --sidebar-bg: #1E3A8A; /* Royal Blue */
    --sidebar-active: #152760; /* Darker Royal Blue */
    --card-shadow: 0 2px 10px rgba(30, 58, 138, 0.1); /* Blue tinted shadow */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #D4AF37; /* Gold */
    --info: #1E3A8A; /* Royal Blue */
}

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

body {
    font-family: var(--body-font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark-grey);
    background-color: #f0f2f5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

a {
    color: var(--secondary-blue);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-gold);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

/* Login Page Styles - Redesigned for more professional look */
.login-page {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: "";
    position: absolute;
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    background: url('/assets/images/pattern-overlay.png'), linear-gradient(135deg, rgba(30, 58, 138, 0.8), rgba(45, 78, 160, 0.9));
    background-blend-mode: overlay;
    opacity: 0.1;
    animation: backgroundMove 60s linear infinite;
}

@keyframes backgroundMove {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(-5%, -5%) rotate(1deg);
    }
}

.login-container {
    max-width: 450px;
    width: 100%;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.login-header {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.login-header .logo {
    margin-bottom: 20px;
}

.login-header .logo img {
    height: 60px;
}

.login-header h1 {
    font-size: 24px;
    color: var(--primary-blue);
    margin: 0;
}

.login-header p {
    color: var(--grey);
    margin-top: 10px;
}

.login-form {
    padding: 30px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-grey);
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--grey);
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.remember-me {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.checkbox {
    display: flex;
    align-items: center;
}

.checkbox input {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.forgot-link {
    font-size: 13px;
    color: var(--secondary-blue);
}

.login-btn {
    width: 100%;
    padding: 12px 15px;
    background: linear-gradient(to right, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(30, 58, 138, 0.3);
}

.login-btn i {
    margin-left: 8px;
}

.login-btn:hover {
    background: linear-gradient(to right, #152760, var(--primary-blue));
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(30, 58, 138, 0.4);
}

.tenant-selector {
    margin-bottom: 20px;
    position: relative;
}

.tenant-selector select {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat;
    background-position: right 15px center;
    background-size: 15px;
}

.tenant-selector .input-icon {
    left: 15px;
}

.tenant-selector select:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.login-footer {
    padding: 15px 30px;
    text-align: center;
    font-size: 12px;
    color: var(--grey);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background-color: #e1f0ff;
    color: #0c5460;
    border-left: 4px solid #1E3A8A;
}

/* Standard components used across all admin pages */

/* Dashboard Layout */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--white);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

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

.sidebar-header .logo img {
    height: 40px;
}

.sidebar-menu {
    padding: 20px 0;
    overflow-y: auto;
    height: calc(100vh - 80px);
}

.menu-item {
    position: relative;
}

.menu-item a {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: all 0.3s ease;
}

.menu-item a:hover, .menu-item.active a {
    background-color: var(--sidebar-active);
    color: var(--white);
}

.menu-item i {
    margin-right: 10px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    transition: all 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    padding: 20px;
    flex-grow: 1;
}

.content-header {
    margin-bottom: 20px;
}

.content-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.breadcrumb {
    color: var(--grey);
    font-size: 13px;
}

/* Buttons */
.btn {
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-right: 5px;
}

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

.btn-primary:hover {
    background-color: var(--secondary-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(30, 58, 138, 0.2);
}

.btn-secondary {
    background-color: var(--light-grey);
    color: var(--dark-grey);
}

.btn-secondary:hover {
    background-color: #e6e6e6;
}

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

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Forms */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

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

/* Cards */
.card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2, .card-header h3 {
    margin: 0;
    font-size: 18px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #fafafa;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f9f9f9;
    font-weight: 600;
    color: var(--primary-blue);
}

tbody tr:hover {
    background-color: #f9f9f9;
}

/* Status badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-block;
}

.status-active {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.status-inactive {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.status-suspended {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.status-new {
    background-color: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

.status-inprogress, .status-in_progress {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.status-approved {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.status-rejected {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 0;
    transform: translateY(-20px);
    transition: all 0.3s;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #6c757d;
    transition: all 0.2s;
}

.modal-close:hover {
    color: #343a40;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive */
@media (max-width: 992px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .topbar {
        padding: 10px 15px;
    }
}

/* Global Bottom Navigation (mobile/tablet) */
.v100-bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 60px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  display: none;
  z-index: 1500;
}

.v100-bottom-nav .v100-bottom-item {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #475569;
  font-weight: 500;
  font-size: 11px;
}

.v100-bottom-nav .v100-bottom-item i {
  font-size: 18px;
  margin-bottom: 3px;
  color: #64748b;
}

.v100-bottom-nav .v100-bottom-item.active,
.v100-bottom-nav .v100-bottom-item:hover {
  color: #1f2937;
}

.v100-bottom-nav .v100-bottom-item.active i {
  color: #3b82f6;
}

@media (max-width: 1200px) {
  .v100-bottom-nav { display: flex; }
  .v100-main-content { padding-bottom: 72px; }
}

/* Mobile responsiveness polish */
@media (max-width: 992px) {
  .v100-topbar-title { font-size: 1.125rem; }
  .v100-topbar-right { gap: 0.5rem; }
}

@media (max-width: 768px) {
  .v100-dashboard-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .v100-dashboard-actions { width: 100%; flex-wrap: wrap; gap: 0.5rem; }
  .v100-form-row { display: flex; flex-direction: column; gap: 12px; }
  /* Make all tables horizontally scrollable on small screens */
  table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { white-space: nowrap; }
}

/* Safer word breaking for long content */
td, th { overflow-wrap: anywhere; word-break: break-word; }
