/**
 * Restaurant Finance Tracker - Main Stylesheet
 * Mobile-first responsive design
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --success-color: #4CAF50;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f5f5;
    --border-color: #ddd;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: white;
    box-shadow: var(--shadow);
    padding: 15px 0;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav a {
    color: var(--text-dark);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav a:hover {
    background: var(--bg-light);
}

.nav a.active {
    background: var(--primary-color);
    color: white;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 20px;
}

.card-header {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-control.error {
    border-color: var(--danger-color);
}

.form-error {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 5px;
}

.form-help {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 5px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #1976D2;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-outline {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

tr:hover {
    background: #fafafa;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--text-dark);
}

.stat-change {
    font-size: 14px;
    margin-top: 8px;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Link Box */
.link-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.link-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.link-url {
    display: flex;
    gap: 10px;
    align-items: center;
}

.link-url input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-light);
    font-family: monospace;
    font-size: 14px;
}

.copy-btn {
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #1976D2;
}

/* Invoice Grid */
.invoice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.invoice-item {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s;
}

.invoice-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.invoice-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--bg-light);
}

.invoice-info {
    padding: 15px;
}

.invoice-amount {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.invoice-category {
    font-size: 14px;
    color: var(--text-light);
    margin: 5px 0;
}

.invoice-date {
    font-size: 12px;
    color: var(--text-light);
}

/* Filters */
.filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--bg-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.testimonial-card {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-color);
  transition: transform .2s ease, box-shadow .2s ease;
}
.testimonial-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.testimonial-head { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.avatar { width:44px; height:44px; border-radius:50%; object-fit:cover; background:#eee; }
.t-name { font-weight:700; }
.t-role { font-size: 13px; color: var(--text-light); }
.t-stars { color:#FFB300; margin: 6px 0; letter-spacing:2px; }
.t-quote { color: var(--text-dark); }


@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .nav {
        flex-direction: column;
        width: 100%;
    }

    .nav a {
        width: 100%;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .link-url {
        flex-direction: column;
    }

    .link-url input {
        width: 100%;
    }

    table {
        font-size: 14px;
    }

    th, td {
        padding: 8px;
    }
}

/* Print Styles */
@media print {
    .header, .nav, .btn, .filters {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}



/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: var(--text-light); }
.fw-bold { font-weight: bold; }


/*model */

.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:1000; justify-content:center; align-items:center; padding:20px; }
.modal-overlay.active { display:flex; }
.modal-content { background:white; padding:25px; border-radius:8px; max-width:460px; width:100%; box-shadow:0 5px 15px rgba(0,0,0,0.3); position:relative; animation:slide-down .25s ease-out; }
.modal-close { position:absolute; top:8px; right:12px; font-size:30px; cursor:pointer; color:#999; }
.modal-close:hover { color:#333; }
@keyframes slide-down { from { transform: translateY(-12px); opacity:0; } to { transform: translateY(0); opacity:1; } }

/* Footer */
.site-footer {
  background: #0f1720;
  color: #cfd8e3;
  margin-top: 40px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 30px;
  padding: 40px 20px;
}
.footer-col { min-width: 220px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-logo { height: 36px; width: auto; display: block; }
.brand-name { font-weight: 700; color: #ffffff; }
.brand-tagline { color: #a8b3c7; font-size: 14px; }
.footer-title { font-weight: 700; color: #ffffff; margin-bottom: 10px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: 8px 0; }
.footer-links a { color: #cfd8e3; text-decoration: none; }
.footer-links a:hover { color: #ffffff; text-decoration: underline; }
.trust-badges { display: flex; flex-wrap: wrap; gap: 10px; color: #9fb0c7; font-size: 12px; margin-top: 10px; }

.footer-newsletter { display: flex; gap: 8px; }
.footer-newsletter .form-control { background: #0b121a; border: 1px solid #2a3749; color: #e3e9f2; }
.footer-newsletter .form-control::placeholder { color: #6b7b90; }
.footer-newsletter .btn { white-space: nowrap; }

.footer-social { display: flex; gap: 10px; margin-top: 8px; }
.footer-social a { font-size: 20px; text-decoration: none; }
.footer-social a:hover { opacity: 0.85; }

.footer-bottom {
  border-top: 1px solid #1b2633;
  padding: 12px 0;
  background: #0b121a;
  color: #8fa3bb;
  font-size: 14px;
}
.footer-bottom-inner { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.footer-mini-links { display: flex; gap: 8px; align-items: center; }
.footer-mini-links a { color: #9fb0c7; text-decoration: none; }
.footer-mini-links a:hover { color: #ffffff; text-decoration: underline; }

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}

/* Quick Filters Enhancement */
.quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-filters .btn {
  padding: 10px 16px;
  font-size: 14px;
  transition: all .2s ease;
  position: relative;
}

.quick-filters .btn.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
  transform: translateY(-1px);
}

.quick-filters .btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px 2px 0 0;
}

.quick-filters .btn:not(.active):hover {
  background: rgba(76, 175, 80, 0.08);
  transform: translateY(-1px);
}

/* Custom Date Filter Card */
#date-filter {
  animation: slideDown .3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

#date-filter .form-control {
  border: 1px solid var(--border-color);
}

#date-filter .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}


/* Button Sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 18px;
}

/* Danger Button */
.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
}

/* Account Page Specific */
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.account-section {
    background: white;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 14px;
}

.info-value {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
    text-align: right;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-trialing {
    background: #cce5ff;
    color: #004085;
}

.status-past_due {
    background: #fff3cd;
    color: #856404;
}

.status-canceled {
    background: #f8d7da;
    color: #721c24;
}

.status-inactive {
    background: #e9ecef;
    color: #6c757d;
}

@media (max-width: 768px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .info-value {
        text-align: left;
    }
}



.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
    margin-top: 5px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

