/* ======================================================
   DataTux — Clean, Apple-inspired styling
   ====================================================== */

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

:root {
    --bg: #f5f5f7;
    --card-bg: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --primary: #0071e3;
    --primary-hover: #0077ed;
    --border: #d2d2d7;
    --error: #ff3b30;
    --success: #34c759;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* NAV */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    font-size: 18px;
    font-weight: 600;
}

.nav-separator {
    color: var(--text-secondary);
    margin: 0 4px;
}

.nav-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

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

/* CONTAINER */
.container {
    max-width: 640px;
    margin: 40px auto;
    padding: 0 20px;
}

/* CARDS */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 24px;
}

.card h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
}

.card-error {
    border-left: 4px solid var(--error);
}

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

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

.form-group input {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, opacity 0.2s;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    margin-left: 12px;
}

.btn-secondary:hover {
    background: #e8e8ed;
}

.btn-full {
    width: 100%;
}

/* PROGRESS */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* LOG */
.log {
    background: #1d1d1f;
    color: #a1a1a6;
    border-radius: 8px;
    padding: 16px;
    font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    max-height: 240px;
    overflow-y: auto;
}

.log-entry {
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.log-entry:last-child {
    border-bottom: none;
    color: #f5f5f7;
}

/* RESULTS */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.result-item {
    background: var(--bg);
    border-radius: 8px;
    padding: 14px 16px;
}

.result-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.result-value {
    display: block;
    font-size: 15px;
    font-weight: 600;
    word-break: break-all;
}

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

.alert-error {
    background: #fff2f0;
    color: var(--error);
    border: 1px solid #ffd4d1;
}

/* LOGIN PAGE */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 380px;
}

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

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 4px;
}

/* DASHBOARD GRID */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.app-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.app-card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.app-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
}

.app-card p {
    font-size: 13px;
    color: var(--text-secondary);
}

.app-card.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.badge-coming-soon {
    display: inline-block;
    font-size: 11px;
    background: var(--bg);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 8px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .result-grid {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 0 16px;
    }
    .card {
        padding: 24px;
    }
}
