/* Cash Flow Management - Professional Styling */
/* Sprint 4.1 - Commercial Migration to LA CRÈME Standards */
/* Phase 1: Simplification Update */

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.cash-flow-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
}

/* Header Section */
.header-section {
    background: white;
    border-radius: 20px;
    padding: 30px 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header-section h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: #1d1d1f;
    margin: 0 0 5px 0;
    letter-spacing: -1px;
}

.header-section p {
    color: #86868b;
    font-size: 1rem;
    margin: 0;
}

/* Status Cards */
.status-card { 
    background: white; 
    border-radius: 20px; 
    padding: 30px; 
    margin-bottom: 20px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.status-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.2s;
    border-left: 4px solid #e9ecef;
}

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

.stat-sales { border-left-color: #30d158; }
.stat-withdrawals { border-left-color: #ff9500; }
.stat-expenses { border-left-color: #ff3b30; }
.stat-cod { border-left-color: #007bff; }

.stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-count {
    font-size: 0.8rem;
    color: #86868b;
}

/* Quick Actions Bar */
.quick-actions-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-action-menu {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Actions Menu Dropdown */
.actions-menu {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #f2f2f7;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.action-menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.action-menu-item:hover {
    background: white;
    border-color: #007bff;
    transform: translateX(4px);
}

.action-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.action-title {
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 2px;
}

.action-desc {
    font-size: 0.85rem;
    color: #86868b;
}

/* COD Card */
.cod-card {
    border-left: 4px solid #007bff;
}

/* Badges */
.badge-success {
    background: #30d158;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Buttons */
.btn { 
    padding: 12px 24px; 
    border: none; 
    border-radius: 12px; 
    cursor: pointer; 
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-primary { 
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%); 
    color: white; 
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.3);
}

.btn-success { 
    background: linear-gradient(135deg, #30d158 0%, #28a745 100%); 
    color: white; 
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40,167,69,0.3);
}

.btn-danger { 
    background: linear-gradient(135deg, #ff3b30 0%, #dc3545 100%); 
    color: white; 
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220,53,69,0.3);
}

.btn-secondary { 
    background: #f2f2f7; 
    color: #1d1d1f; 
}

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

.btn-link {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 8px 0;
    text-decoration: none;
}

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

.btn-icon {
    background: #f2f2f7;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #e5e5ea;
    transform: scale(1.1);
}

.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 25px;
    border: none;
    color: #007bff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.2s;
    z-index: 100;
}

.back-btn:hover {
    background: white;
    transform: translateY(-2px);
}

/* Transaction List */
.transaction-list { 
    max-height: 400px; 
    overflow-y: auto; 
}

.transaction-item { 
    padding: 15px; 
    border-bottom: 1px solid #f2f2f7; 
    display: flex; 
    justify-content: space-between;
    transition: all 0.2s;
}

.transaction-item:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

/* Modals */
.modal { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.7); 
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content { 
    background: white; 
    margin: 50px auto; 
    padding: 0;
    max-width: 500px; 
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header { 
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 25px 30px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-header.success-header {
    background: linear-gradient(135deg, #30d158 0%, #28a745 100%);
}

.modal-body {
    padding: 30px;
}

.close { 
    font-size: 28px; 
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

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

.form-group label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600;
    color: #1d1d1f;
    font-size: 0.95rem;
}

.form-group input, 
.form-group select, 
.form-group textarea { 
    width: 100%; 
    padding: 12px; 
    border: 2px solid #e5e5ea; 
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Alerts & Warnings */
.alert-warning {
    background: #fff3cd;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
    font-size: 0.9rem;
}

.variance-warning {
    padding: 15px;
    background: #fff3cd;
    border-radius: 12px;
    margin-bottom: 15px;
}

.variance-positive {
    color: #30d158;
}

.variance-negative {
    color: #ff3b30;
}

/* Utility Classes */
.hidden { 
    display: none !important; 
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-section h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    .quick-actions-bar {
        flex-direction: column;
    }
    
    .btn-action-menu {
        width: 100%;
    }
    
    .actions-menu {
        grid-template-columns: 1fr;
    }
}


/* ============================= */
/* Toggle Switch Styles */
/* ============================= */

/* CRITICAL: Pre-hide amounts for staff to prevent flash */
.amount-hidden {
  visibility: hidden !important;
}

.amount-visible {
  visibility: visible !important;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #30d158;
}

input:focus + .slider {
  box-shadow: 0 0 1px #30d158;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Section Controls Panel */
#sectionControlsPanel {
  animation: slideDown 0.3s ease-out;
}

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

/* Hide sections with smooth transition */
.section-hidden {
  display: none !important;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}


/* Role Tab Styles */
.role-tab {
  transition: all 0.3s ease;
}

.role-tab:hover {
  opacity: 0.8;
}

.role-tab.active {
  background: #007bff !important;
  color: white !important;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #ddd;
  margin-bottom: 10px;
}

.setting-row:hover {
  background: #f8f9fa;
  border-color: #007bff;
}
