/* Consent GPS Clean Modern Stylesheet */
:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 8px;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    font-size: 1.4rem;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.brand-badge {
    background-color: #1e293b;
    color: #94a3b8;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
    width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h1 {
    font-size: 1.875rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.header-badges {
    display: flex;
    gap: 0.5rem;
}

.policy-notice {
    background-color: #f0fdf4;
    border-left: 4px solid var(--success);
    color: #166534;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.925rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-header {
    margin-bottom: 1.25rem;
}

.card-header h2, .card-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stats-list {
    list-style: none;
}

.stats-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.925rem;
}

.stats-label {
    color: var(--text-secondary);
}

.stats-value {
    font-weight: 600;
}

.callout {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

.callout-info {
    background-color: #eff6ff;
    border-left: 3px solid var(--primary);
    color: #1e40af;
}

/* Device List */
.device-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.device-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem;
    background: #fafafa;
    transition: border-color 0.15s ease;
}

.device-card:hover {
    border-color: #cbd5e1;
}

.device-revoked {
    opacity: 0.6;
    background: #fef2f2;
    border-color: #fecaca;
}

.device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.device-name {
    font-size: 1.15rem;
    font-weight: 700;
}

.device-id {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.device-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.device-info-grid .label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.4rem;
}

.latest-fix-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.875rem;
    margin-top: 0.5rem;
}

.box-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.fix-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.5rem;
    font-size: 0.875rem;
}

.link-external {
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
}

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

/* Locate Command Box */
.locate-command-box {
    background: #f8fafc;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.75rem;
}

.locate-status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-muted { background: #e2e8f0; color: #64748b; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: #e2e8f0; color: #1e293b; }
.btn-secondary:hover { background: #cbd5e1; }

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

.btn-outline-primary {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-outline-secondary {
    background: transparent;
    border-color: #94a3b8;
    color: #475569;
}
.btn-outline-secondary:hover {
    background: #e2e8f0;
}

.btn-outline-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}
.btn-outline-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.inline-form-flex {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.flex-1 { flex: 1; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

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

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th, .table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Alerts */
.flash-messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success, .alert-code_success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

.show-once-code {
    display: block;
    margin: 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.show-once-code code {
    background-color: #ffffff;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    border: 1px dashed #166534;
    user-select: all;
}

.badge-subtext {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    margin-top: 0.25rem;
    font-weight: normal;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius);
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Login card */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
}

.login-card {
    max-width: 420px;
    width: 100%;
}

.login-footer {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.footer {
    border-top: 1px solid var(--border-color);
    background-color: #fff;
    padding: 1.25rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}
