/* e-Ranch Pro — Control Panel styles. Deliberately different colors from
   the ranch product's own theme, so it's visually obvious this is a
   different application. */

:root {
    --color-primary: #1f4e79;
    --color-primary-dark: #163a5c;
    --color-accent: #2d8f6f;
    --color-bg: #f4f6f8;
    --color-card: #ffffff;
    --color-text: #222;
    --color-border: #dfe3e8;
    --color-success: #2e7d32;
    --color-error: #c0392b;
    --color-warning: #b8860b;
    --radius: 8px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 16px;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.login-box {
    background: var(--color-card);
    padding: 2.5rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}

.login-box h1 { margin: 0 0 .25rem; text-align: center; color: var(--color-primary-dark); }
.login-box .subtitle { text-align: center; color: #888; margin-bottom: 1.5rem; font-style: italic; }

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

.app-sidebar {
    width: 220px;
    background: var(--color-primary-dark);
    color: #fff;
    padding: 1.5rem 1rem;
    flex-shrink: 0;
}

.sidebar-brand { font-size: 1.15rem; font-weight: bold; margin-bottom: 1.5rem; line-height: 1.4; }
.sidebar-brand small { font-weight: 400; opacity: .8; font-size: .75rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: .5rem; }
.sidebar-nav a { color: #dce6f0; padding: .5rem .75rem; border-radius: var(--radius); }
.sidebar-nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; }

.app-main { flex: 1; display: flex; flex-direction: column; }

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

.app-content { padding: 1.5rem; flex: 1; }

.app-footer { padding: 1rem 1.5rem; text-align: center; color: #999; font-size: .85rem; }

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

.btn {
    display: inline-block;
    padding: .55rem 1rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: .95rem;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn-secondary { background: #eee; color: var(--color-text); }

.link-btn {
    background: none;
    border: none;
    color: var(--color-error);
    cursor: pointer;
    padding: 0;
    font-size: .9rem;
    text-decoration: underline;
}

.table { width: 100%; border-collapse: collapse; background: var(--color-card); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
.table th { background: #eef2f6; font-weight: 600; }

.form { max-width: 480px; display: flex; flex-direction: column; gap: .35rem; }
.form label { font-weight: 600; margin-top: .5rem; }
.form input, .form select, .form textarea {
    padding: .55rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    width: 100%;
}
.form textarea { min-height: 80px; }
.form-actions { margin-top: 1rem; display: flex; gap: .75rem; }
.checkbox-inline { display: inline-flex; align-items: center; gap: .35rem; font-weight: normal; margin-right: 1rem; }

.field-error { color: var(--color-error); font-size: .85rem; }

.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-success { background: #e6f4ea; color: var(--color-success); }
.alert-error { background: #fdecea; color: var(--color-error); }

.plan-info { color: #777; margin-bottom: 1rem; }

.cards-grid { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.card { background: var(--color-card); border-radius: var(--radius); padding: 1rem 1.5rem; min-width: 180px; box-shadow: 0 2px 6px rgba(0,0,0,.05); }
.card h3 { margin: 0 0 .5rem; font-size: .9rem; color: #888; }
.card-value { margin: 0; font-size: 1.75rem; font-weight: bold; color: var(--color-primary-dark); }

.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.badge-success { background: #e6f4ea; color: var(--color-success); }
.badge-warning { background: #fdf3e0; color: var(--color-warning); }
.badge-error   { background: #fdecea; color: var(--color-error); }
.badge-muted   { background: #ececec; color: #777; }

.agreement-box {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-height: 420px;
    overflow-y: auto;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .app-shell { flex-direction: column; }
    .app-sidebar { width: 100%; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
}
