/* ============================================================================
   COBBLESTONE DIGITAL — ADMIN PANEL STYLES
   Navy & Gold branding throughout
   ============================================================================ */

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

:root {
    --navy: #1B2A4A;
    --navy-light: #2A3F6A;
    --navy-dark: #111D35;
    --gold: #C9A84C;
    --gold-light: #E0C878;
    --gold-dark: #A88A30;
    --white: #FFFFFF;
    --gray-50: #F8F9FA;
    --gray-100: #F0F2F5;
    --gray-200: #E2E6EA;
    --gray-300: #CED2D8;
    --gray-400: #A0A8B4;
    --gray-500: #6C7A8A;
    --gray-600: #4A5568;
    --gray-700: #2D3748;
    --gray-800: #1A202C;
    --green: #10B981;
    --green-bg: #ECFDF5;
    --red: #EF4444;
    --red-bg: #FEF2F2;
    --yellow: #F59E0B;
    --yellow-bg: #FFFBEB;
    --blue: #3B82F6;
    --blue-bg: #EFF6FF;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-100);
    color: var(--gray-700);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold); }

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
}

.login-container {
    width: 400px;
    max-width: 90vw;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: var(--gold);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--navy-dark);
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
}

.login-logo h1 {
    color: var(--white);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
}

.login-logo p {
    color: var(--gray-400);
    font-size: 13px;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-lg);
}

.login-card h2 {
    color: var(--navy);
    font-size: 18px;
    margin-bottom: 24px;
    text-align: center;
}

/* ============================================================================
   FORMS
   ============================================================================ */

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--gray-700);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--navy);
    color: var(--white);
    width: 100%;
    padding: 12px 20px;
}

.btn-primary:hover { background: var(--navy-light); color: var(--white); }

.btn-gold {
    background: var(--gold);
    color: var(--navy-dark);
}

.btn-gold:hover { background: var(--gold-light); color: var(--navy-dark); }

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

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-600);
}

.btn-outline:hover { border-color: var(--navy); color: var(--navy); }

.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error { background: var(--red-bg); color: var(--red); border-left: 4px solid var(--red); }
.alert-success { background: var(--green-bg); color: #065F46; border-left: 4px solid var(--green); }
.alert-warning { background: var(--yellow-bg); color: #92400E; border-left: 4px solid var(--yellow); }
.alert-info { background: var(--blue-bg); color: #1E40AF; border-left: 4px solid var(--blue); }

/* ============================================================================
   LAYOUT — Sidebar + Main
   ============================================================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--gold);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--navy-dark);
    flex-shrink: 0;
}

.sidebar-header .sidebar-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.sidebar-header .sidebar-subtitle {
    font-size: 11px;
    color: var(--gray-400);
    letter-spacing: 0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-500);
    padding: 8px 20px;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--gray-300);
    font-size: 14px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
    border-left-color: var(--gold);
}

.nav-link.active {
    background: rgba(201, 168, 76, 0.1);
    color: var(--gold);
    border-left-color: var(--gold);
    font-weight: 600;
}

.nav-link .nav-icon { width: 20px; text-align: center; font-size: 16px; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sidebar-user .user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gold);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy-dark);
}

.sidebar-user .user-info { font-size: 13px; line-height: 1.3; }
.sidebar-user .user-name { font-weight: 600; color: var(--white); }
.sidebar-user .user-role { font-size: 11px; color: var(--gray-400); }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px 32px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    color: var(--navy);
    font-weight: 700;
}

.page-header .page-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ============================================================================
   CARDS & STAT BOXES
   ============================================================================ */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
}

.card-body { padding: 20px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    border-top: 3px solid var(--navy);
}

.stat-box.gold { border-top-color: var(--gold); }
.stat-box.green { border-top-color: var(--green); }
.stat-box.red { border-top-color: var(--red); }

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    font-weight: 600;
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table-container { overflow-x: auto; }

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

thead th {
    background: var(--gray-50);
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    font-weight: 700;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

tbody td {
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
}

tbody tr:hover { background: var(--gray-50); }

/* ============================================================================
   BADGES
   ============================================================================ */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active { background: var(--green-bg); color: #065F46; }
.badge-pending { background: var(--yellow-bg); color: #92400E; }
.badge-suspended { background: var(--red-bg); color: var(--red); }
.badge-canceled { background: var(--gray-100); color: var(--gray-500); }
.badge-success { background: var(--green-bg); color: #065F46; }
.badge-failed { background: var(--red-bg); color: var(--red); }
.badge-mfa { background: rgba(201,168,76,0.15); color: var(--gold-dark); }
.badge-warning { background: var(--yellow-bg); color: #92400E; border: 1px solid var(--yellow); }

/* ============================================================================
   GRID LAYOUT HELPERS
   ============================================================================ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-400); }
.text-sm { font-size: 12px; }
.text-mono { font-family: 'SF Mono', 'Consolas', 'Monaco', monospace; font-size: 12px; }

/* ============================================================================
   MFA SETUP
   ============================================================================ */

.mfa-qr {
    text-align: center;
    padding: 20px;
}

.mfa-qr img {
    border: 4px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 8px;
    background: var(--white);
}

.mfa-secret {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--navy);
    margin: 16px 0;
    word-break: break-all;
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray-400);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; color: var(--gray-500); margin-bottom: 4px; }
.empty-state p { font-size: 13px; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 1024px) {
    .sidebar { width: 200px; }
    .main-content { margin-left: 200px; padding: 20px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
/* ============================================================================
   TENANT PAGES — Additional Styles
   Append this to the end of style.css
   ============================================================================ */

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--white);
    color: var(--gray-600);
    border: 2px solid var(--gray-200);
    transition: all 0.15s;
    text-decoration: none;
}

.pill:hover { border-color: var(--navy); color: var(--navy); }
.pill.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.pill-green.active { background: var(--green); border-color: var(--green); }
.pill-gold.active { background: var(--gold); color: var(--navy-dark); border-color: var(--gold); }
.pill-blue.active { background: var(--blue); border-color: var(--blue); }
.pill-red.active { background: var(--red); border-color: var(--red); }
.pill-gray.active { background: var(--gray-500); border-color: var(--gray-500); }

.pill-count {
    background: rgba(255,255,255,0.2);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
}

.pill:not(.active) .pill-count {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* Form Layout */
.form-row {
    display: flex;
    gap: 16px;
}

.form-half { flex: 1; }
.form-third { flex: 1; }

.form-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

.form-hint span {
    font-family: 'SF Mono', 'Consolas', monospace;
    color: var(--navy);
    font-weight: 600;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236C7A8A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Plan Selection Grid */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.plan-option {
    cursor: pointer;
}

.plan-option input[type="radio"] {
    display: none;
}

.plan-card {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
}

.plan-option input:checked + .plan-card {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.05);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.plan-card:hover {
    border-color: var(--gold-light);
}

.plan-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}

.plan-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--gold-dark);
    margin-bottom: 8px;
}

.plan-details {
    font-size: 12px;
    color: var(--gray-500);
}

/* Provision Actions */
.provision-actions {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.provision-warning {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    white-space: nowrap;
}

/* Detail Grid */
.detail-grid {
    display: flex;
    flex-direction: column;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
}

/* Onboarding Checklist */
.checklist {
    display: flex;
    flex-direction: column;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    color: var(--gray-600);
}

.checklist-item:last-child { border-bottom: none; }

.checklist-item.complete { color: var(--gray-400); }
.checklist-item.complete .check-label { text-decoration: line-through; }

.check-icon { font-size: 16px; width: 24px; text-align: center; }
.check-label { flex: 1; }
.check-date { font-size: 11px; }

/* Admin Notes */
.note-item {
    padding: 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.note-item.pinned {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.03);
}

.note-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.note-body {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.5;
}

/* Responsive adjustments for forms */
@media (max-width: 768px) {
    .form-row { flex-direction: column; }
    .plan-grid { grid-template-columns: 1fr; }
    .provision-actions { flex-direction: column; text-align: center; }
}
