/* Patrimoniza Admin - Design System */
:root {
    --brand-primary: #002947;
    --brand-secondary: #0066CC;
    --brand-accent: #10B981;
    --brand-primary-light: #00699B;
    --brand-bg: #F9FAFB;
    --brand-bg-dark: #111827;
    --brand-text: #111827;
    --brand-text-muted: #6B7280;
    --brand-border: #E5E7EB;
    --brand-white: #FFFFFF;
    --brand-error: #EF4444;
    --brand-warning: #F59E0B;
    --brand-info: #3B82F6;
    --shadow-sm: 0 1px 2px 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-brand: 0 10px 15px -3px rgba(0,41,71,0.25);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 200ms ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--brand-text); background: var(--brand-bg); line-height: 1.6; }
h1,h2,h3,h4,h5,h6 { font-family: 'Poppins', system-ui, sans-serif; font-weight: 700; line-height: 1.2; }

/* Login */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-bg-dark), var(--brand-primary), var(--brand-bg-dark));
    padding: 24px;
}
.login-card {
    background: var(--brand-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}
.login-card img { height: 48px; margin-bottom: 32px; }
.login-card h2 { font-size: 24px; margin-bottom: 8px; color: var(--brand-primary); }
.login-card p { color: var(--brand-text-muted); margin-bottom: 24px; font-size: 14px; }
.login-card .form-group { margin-bottom: 16px; text-align: left; }
.login-card .error-msg { color: var(--brand-error); font-size: 13px; margin-top: 12px; display: none; }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 260px;
    background: var(--brand-primary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-header img { height: 36px; }
.sidebar-header span { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14px; opacity: 0.9; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover { color: white; background: rgba(255,255,255,0.08); }
.sidebar-nav a.active {
    color: white;
    background: rgba(255,255,255,0.12);
    border-left-color: var(--brand-accent);
}
.sidebar-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-footer .user-info { font-size: 13px; opacity: 0.8; }
.sidebar-footer button {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: background var(--transition);
}
.sidebar-footer button:hover { background: rgba(255,255,255,0.2); }

/* Main Content */
.admin-main {
    margin-left: 260px;
    flex: 1;
    padding: 0;
    min-height: 100vh;
}
.admin-header {
    background: var(--brand-white);
    border-bottom: 1px solid var(--brand-border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-header h1 { font-size: 20px; color: var(--brand-primary); }
.admin-header .header-meta { font-size: 13px; color: var(--brand-text-muted); display: flex; align-items: center; gap: 16px; }
.admin-content { padding: 32px; max-width: 1100px; }

/* Tab Content */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Cards / Sections */
.config-card {
    background: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}
.config-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--brand-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.config-card-header h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.config-card-body { padding: 24px; }

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-lp { background: #DBEAFE; color: #1E40AF; }
.badge-site { background: #D1FAE5; color: #065F46; }
.badge-both { background: #FEF3C7; color: #92400E; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-error { background: #FEE2E2; color: #991B1B; }

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.form-label .badge { margin-left: 8px; vertical-align: middle; }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--brand-text);
    background: var(--brand-white);
    border: 1px solid #D1D5DB;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--brand-primary-light);
    box-shadow: 0 0 0 3px rgba(0,105,155,0.15);
    outline: none;
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--brand-text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Toggle */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}
.toggle-label { font-size: 14px; font-weight: 500; }
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}
.toggle input { display: none; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 12px;
    transition: background var(--transition);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--brand-accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-primary {
    color: white;
    background: linear-gradient(to right, var(--brand-primary), var(--brand-secondary));
    box-shadow: var(--shadow-brand);
}
.btn-primary:hover { box-shadow: 0 20px 25px -5px rgba(0,41,71,0.3); transform: translateY(-1px); }
.btn-secondary {
    color: var(--brand-primary);
    background: transparent;
    border: 2px solid var(--brand-primary);
}
.btn-secondary:hover { background: var(--brand-primary); color: white; }
.btn-danger { color: white; background: var(--brand-error); }
.btn-danger:hover { background: #DC2626; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Actions Bar */
.actions-bar {
    display: flex;
    gap: 12px;
    padding: 24px;
    background: var(--brand-white);
    border-top: 1px solid var(--brand-border);
    position: sticky;
    bottom: 0;
    z-index: 40;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: white;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast-success { background: #059669; }
.toast-error { background: var(--brand-error); }
.toast-warning { background: var(--brand-warning); color: var(--brand-text); }
.toast-info { background: var(--brand-info); }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Info Box */
.info-box {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 13px;
    color: #166534;
    margin-bottom: 20px;
}
.info-box.warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }

/* Weekday Scheduler */
.weekday-item {
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}
.weekday-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #F9FAFB;
    cursor: pointer;
}
.weekday-header .day-name { font-weight: 600; font-size: 14px; }
.weekday-periods { padding: 12px 16px; display: none; }
.weekday-item.open .weekday-periods { display: block; }
.period-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.period-row input { width: 100px; }
.period-row .remove-period { color: var(--brand-error); cursor: pointer; font-size: 18px; }
.add-period-btn {
    color: var(--brand-secondary);
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
}

/* Depoimentos List */
.depoimento-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}
.depoimento-item .depo-text { flex: 1; }
.depoimento-item .depo-text h4 { font-size: 14px; margin-bottom: 4px; }
.depoimento-item .depo-text p { font-size: 13px; color: var(--brand-text-muted); }
.depoimento-item .depo-actions { display: flex; gap: 8px; }

/* Backups Table */
.backup-table { width: 100%; border-collapse: collapse; }
.backup-table th, .backup-table td { padding: 10px 16px; text-align: left; font-size: 13px; }
.backup-table th { background: #F9FAFB; font-weight: 600; border-bottom: 2px solid var(--brand-border); }
.backup-table td { border-bottom: 1px solid var(--brand-border); }

/* LP Cards */
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.lp-card {
    padding: 20px;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-sm);
    background: var(--brand-white);
}
.lp-card h4 { font-size: 15px; margin-bottom: 8px; }
.lp-card .lp-origin { font-size: 12px; color: var(--brand-text-muted); margin-bottom: 8px; }
.lp-card .lp-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.lp-card .lp-tag { font-size: 11px; background: #E6F2FF; color: #0052A3; padding: 2px 8px; border-radius: 4px; }

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-header { padding: 16px; padding-left: 56px; }
    .admin-content { padding: 16px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .actions-bar { flex-direction: column; }
}
@media (max-width: 480px) {
    .login-card { padding: 32px 24px; }
}
