@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --orange: #ffb406;
    --orange-dark: #e09e00;
    --orange-light: #ffc84a;
    --green: #008a00;
    --green-dark: #006600;
    --dark: #1a1a2e;
    --dark-2: #2d2d2d;
    --gray: #7d7d7d;
    --gray-light: #f5f5f5;
    --gray-lighter: #e8e8e8;
    --white: #ffffff;
    --danger: #dc3545;
    --danger-dark: #c82333;
    --warning: #ffc107;
    --success: #28a745;
    --info: #17a2b8;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

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

body {
    font-family: var(--font-family);
    background: var(--gray-light);
    color: var(--dark-2);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--orange-dark); text-decoration: none; }
a:hover { color: var(--orange); }

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

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

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

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

.logo-text {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: var(--orange);
    letter-spacing: -1px;
}

.logo-sub {
    display: block;
    font-size: 14px;
    color: var(--gray);
    font-weight: 400;
    margin-top: 4px;
}

/* Navbar */
.navbar {
    background: var(--white);
    border-bottom: 3px solid var(--orange);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--orange);
    background: var(--orange);
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
}

.brand-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-2);
}

.nav-menu {
    display: flex;
    gap: 5px;
}

.nav-item {
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--gray);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--gray-light);
    color: var(--dark-2);
}

.nav-item.active {
    background: var(--orange);
    color: white;
}

.nav-logout {
    color: var(--danger);
}
.nav-logout:hover {
    background: #fce4e4;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-2);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 30px;
}

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

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--orange);
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-2);
}

.stat-label {
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
    margin-top: 4px;
}

/* Card */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pg {
    background: #e8f5e9;
    color: var(--green);
}

.badge-wal {
    background: #fff3e0;
    color: var(--orange-dark);
}

.badge-gcs {
    background: #e3f2fd;
    color: #1565c0;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-lighter);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-lighter);
    font-size: 14px;
}

.table tbody tr:hover {
    background: var(--gray-light);
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--gray-lighter);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--orange), var(--orange-dark));
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-text {
    position: absolute;
    right: 4px;
    top: -18px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
}

/* WAL Info */
.wal-info {
    display: grid;
    gap: 12px;
}

.wal-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wal-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-2);
    min-width: 120px;
}

.wal-value {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--gray);
    background: var(--gray-light);
    padding: 4px 10px;
    border-radius: 4px;
    word-break: break-all;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-2);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-lighter);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-family);
    transition: border-color 0.2s;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--orange);
}

select.form-control {
    cursor: pointer;
}

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

.btn-primary {
    background: var(--orange);
    color: white;
}

.btn-primary:hover {
    background: var(--orange-dark);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

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

.btn-danger:hover {
    background: var(--danger-dark);
    transform: translateY(-1px);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fce4e4;
    color: var(--danger);
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3e0;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Restore */
.restore-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--orange);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Search box */
.search-box {
    margin-bottom: 12px;
}

/* Restore Points List */
.restore-points-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--gray-lighter);
    border-radius: 8px;
    margin-bottom: 12px;
}

.restore-point-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-lighter);
    transition: all 0.15s;
}

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

.restore-point-item:hover {
    background: #fff8e6;
}

.restore-point-item.active {
    background: #fff3d0;
    border-left: 3px solid var(--orange);
}

.rp-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.rp-info {
    flex: 1;
    min-width: 0;
}

.rp-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-time {
    font-size: 12px;
    color: var(--gray);
    font-family: 'Courier New', monospace;
    margin-top: 2px;
}

.rp-check {
    font-size: 18px;
    color: var(--orange);
    font-weight: 700;
    flex-shrink: 0;
}

/* Custom time */
.custom-time-section {
    margin-top: 4px;
}

.custom-time-link {
    font-size: 14px;
    color: var(--orange-dark);
    font-weight: 500;
}

.custom-time-link:hover {
    color: var(--orange);
}

#custom-time-picker label {
    display: block;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 6px;
}

.restore-summary {
    background: var(--gray-light);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.restore-summary p {
    font-size: 14px;
    margin-bottom: 4px;
}

.restore-log {
    background: #1a1a2e;
    color: #00ff00;
    padding: 16px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Backup list */
.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-lighter);
}

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

.backup-name {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--dark-2);
    word-break: break-all;
}

.backup-meta {
    font-size: 12px;
    color: var(--gray);
    white-space: nowrap;
}

/* Text utilities */
.text-muted {
    color: var(--gray);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 16px; }
    .navbar { padding: 0 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .step { flex-direction: column; }
    .restore-point-options { flex-direction: column; gap: 8px; }
}
